aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread_2020/lib.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-05-27 12:02:26 +0200
committerGitHub <noreply@github.com>2024-05-27 10:02:26 +0000
commit43a3c9c319e6406c92254031cd05ca23609102ef (patch)
tree257e45934118b6be3833a5f03f0b50596f12c186 /components/layout_thread_2020/lib.rs
parent5f0866379a731628c535593d0022b91cfabfb868 (diff)
downloadservo-43a3c9c319e6406c92254031cd05ca23609102ef.tar.gz
servo-43a3c9c319e6406c92254031cd05ca23609102ef.zip
fonts: Improve font fallback (#32286)
- 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.
Diffstat (limited to 'components/layout_thread_2020/lib.rs')
-rw-r--r--components/layout_thread_2020/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/layout_thread_2020/lib.rs b/components/layout_thread_2020/lib.rs
index 4d518d78d77..c581ab5f997 100644
--- a/components/layout_thread_2020/lib.rs
+++ b/components/layout_thread_2020/lib.rs
@@ -1218,7 +1218,7 @@ impl FontMetricsProvider for LayoutFontMetricsProvider {
.or_else(|| {
font_group
.write()
- .find_by_codepoint(font_context, '0')?
+ .find_by_codepoint(font_context, '0', None)?
.metrics
.zero_horizontal_advance
})
@@ -1229,7 +1229,7 @@ impl FontMetricsProvider for LayoutFontMetricsProvider {
.or_else(|| {
font_group
.write()
- .find_by_codepoint(font_context, '\u{6C34}')?
+ .find_by_codepoint(font_context, '\u{6C34}', None)?
.metrics
.ic_horizontal_advance
})