-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: Add Font Fallback #1833
feat: Add Font Fallback #1833
Conversation
Thanks @ahmed-novalabs for working on this! Can you provide a test plan for this PR? If I understood correctly, user will need to provide a |
@diegomura I think the main benefit is optimization by only loading the used fonts based on the text and There is a similar CSS property. For the testing plan, I don't have a lot of experience with testing, so I am not sure how to make or approach that. If you can provide an example or a guide of what you expect, I can work on it. |
While resolving assets, the first call to load the font will await loading the font correctly, while subsequent calls to load the font will finish before the font is loaded. This sometimes leads to characters not rendering correctly.
What's in this PR
Things to test:
|
Any update on this? |
@ahmed-novalabs Is there specific reason to go with new parameter |
Any updates on this PR? |
I lost access to the @chathu-novade I am not sure I understand the question, fontFamily: "MyFont1, MyFont2" |
@diegomura the unicode-range is a standard CSS feature https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range. For example in one project we use it to make sure all numbers are rendered with the monospaced version of the font for better readability. That said it already would be very helpful to allow to support multiple fonts to support various glyphs e.g. arabic, cyrillic. Most fonts offer dedicated fonts for arabic and so on, because apparently there is a limit of 64K glyphs for a TrueType file (notofonts/noto-fonts#13 (comment)). So you can get Noto Sans and Noto Sans Arabic. Combining multiple fonts is one solution, but at some point you hit the 64K limit again. The easiest going forward afaik would be to allow defining multiple fonts e.g. If you think this is a good idea I would be happy to extract this part from the PR and create a new one. |
@nikgraf i think it is! |
great, will work on it in the coming days |
PR is ready: #2640 |
@diegomura wanted to ask if you could review the PR 🔝 |
We already support this. Closing this |
Should fix #1771, #499.
Is part of #933, #856.