-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
fonts: Improve font fallback #32286
fonts: Improve font fallback #32286
Conversation
🔨 Triggering try run (#9094056322) for Linux WPT |
Test results for linux-wpt-layout-2013 from try job (#9094056322): Flaky unexpected result (15)
Stable unexpected results that are known to be intermittent (10)
Stable unexpected results (1)
|
Test results for linux-wpt-layout-2020 from try job (#9094056322): Flaky unexpected result (14)
Stable unexpected results that are known to be intermittent (16)
|
|
🔨 Triggering try run (#9140281411) for Linux WPT |
Test results for linux-wpt-layout-2013 from try job (#9140281411): Flaky unexpected result (13)
Stable unexpected results that are known to be intermittent (6)
|
Test results for linux-wpt-layout-2020 from try job (#9140281411): Flaky unexpected result (18)
Stable unexpected results that are known to be intermittent (16)
|
✨ Try run (#9140281411) succeeded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just left a very small comment.
components/gfx/font.rs
Outdated
@@ -486,20 +486,23 @@ impl FontGroup { | |||
pub fn find_by_codepoint<S: FontSource>( | |||
&mut self, | |||
font_context: &FontContext<S>, | |||
codepoint: char, | |||
character: char, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have renamed codepoint
to character
in this PR, would it make sense to rename the function as well? maybe something find_by_character
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, great point. I've gone ahead and renamed these parameterscodepoint
and next_codepoint
. It may make sens to rename this function later, but for now it's probably best to keep the same name.
🔨 Triggering try run (#9251684875) for Android |
|
🔨 Triggering try run (#9252114336) for Android |
|
- Better detect situations where emoji is necessary by looking ahead one character while laying out. This allow processing Unicode presentation selectors. When detecting emoji, put emoji fonts at the front of fallback lists for all platforms. This enables monochrome emoji on Windows. Full-color emoji on Windows probably needs full support for processing the COLR table and drawing separate glyph color layers. - Improve the font fallback list on FreeType platforms. Ideally, Servo would be able to look through the entire font list to find the best font for a certain character, but until that time we can make sure the font list contains the "Noto Sans" fonts which cover most situations. Fixes servo#31664. Fixes servo#12944.
🔨 Triggering try run (#9252316744) for Android |
✨ Try run (#9252316744) succeeded. |
Better detect situations where emoji is necessary by looking ahead one
character while laying out. This allow processing Unicode presentation
selectors. When detecting emoji, put emoji fonts at the front of
fallback lists for all platforms.
This enables monochrome emoji on Windows. Full-color emoji on Windows
probably needs full support for processing the COLR table and drawing
separate glyph color layers.
Improve the font fallback list on FreeType platforms. Ideally, Servo
would be able to look through the entire font list to find the best
font for a certain character, but until that time we can make sure the
font list contains the "Noto Sans" fonts which cover most situations.
Fixes #31664.
Fixes #12944.
./mach build -d
does not report any errors./mach test-tidy
does not report any errorsdid, what font it fell back to. I have tested these changes with https://angband.pl/doc/alluni.txt
though and they significantly improve Servo's coverage on Linux. There's more work to do
for macOS and Windows though.