-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve custom loaded fonts #209
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
yisibl
force-pushed
the
better-load-custom-font
branch
from
February 20, 2023 09:06
3a1d771
to
bad1e6c
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
February 20, 2023 09:08
bad1e6c
to
45957fa
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 6, 2023 09:53
45957fa
to
34a27f9
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 6, 2023 09:58
34a27f9
to
381e44f
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 6, 2023 10:24
0288b9f
to
ce3a162
Compare
When `loadSystemFonts: true`, the `defaultFontFamily` option can also be omitted.
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 6, 2023 15:00
ce3a162
to
2c47bb3
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 6, 2023 15:10
2c47bb3
to
eb9ad3a
Compare
…llback Previously, resvg-js would not match any fonts in SVG text, even if there were fonts in the OS that could render them. This commit makes it possible to fallback properly. ```js const resvg = new Resvg(svg, { font: { loadSystemFonts: true, defaultFontFamily: 'this-is-a-non-existent-font-family', }, }) ```
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 7, 2023 12:23
d1b8b49
to
5496a80
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 7, 2023 13:50
4b6b292
to
2d11a0a
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 8, 2023 13:17
38c7f0e
to
faa8e82
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 8, 2023 13:28
faa8e82
to
9e1ec66
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 8, 2023 13:30
9e1ec66
to
c585cd5
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 8, 2023 13:48
c585cd5
to
fc28e1b
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 8, 2023 16:25
efac61f
to
94eb60f
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 9, 2023 07:30
8ebc6d2
to
0911357
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 20, 2023 14:28
0911357
to
9e0be74
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 20, 2023 14:30
9e0be74
to
e01cb8a
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 20, 2023 14:33
e01cb8a
to
e193aa6
Compare
yisibl
force-pushed
the
better-load-custom-font
branch
from
August 20, 2023 14:56
e193aa6
to
07349a6
Compare
zimond
approved these changes
Aug 21, 2023
yisibl
added a commit
that referenced
this pull request
Aug 21, 2023
* feat: improve custom loaded fonts * feat: refactoring and adding test cases When `loadSystemFonts: true`, the `defaultFontFamily` option can also be omitted. * feat(wasm): support for getting the default font-family from `fontsBuffers` * chore: new example/text.js * feat: the defaultFontFamily is not found in the OS and needs to be fallback Previously, resvg-js would not match any fonts in SVG text, even if there were fonts in the OS that could render them. This commit makes it possible to fallback properly. ```js const resvg = new Resvg(svg, { font: { loadSystemFonts: true, defaultFontFamily: 'this-is-a-non-existent-font-family', }, }) ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
defaultFontFamily
option can now be omitted when loading custom fonts. We'll read the font-family from the incoming fonts and set it to the default.This feature is also available in Wasm (previously, loading fonts via the
fontBuffers
option was supported in Wasm).