diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-04-29 19:02:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-29 17:02:07 +0000 |
commit | 4732da347795c7a9e009a5125c20c1f5c3215209 (patch) | |
tree | 9244f043b9049c2e14d4984fa8012e3eb7c15f87 /components/gfx/platform/windows/font.rs | |
parent | 628e33bfa95b286e1b8b974e426ffdad7850097e (diff) | |
download | servo-4732da347795c7a9e009a5125c20c1f5c3215209.tar.gz servo-4732da347795c7a9e009a5125c20c1f5c3215209.zip |
fonts: Add support for more @font-face features (#32164)
There are a couple major changes here:
1. Support is added for the `weight`, `style`, `stretch` and
`unicode-range` declarations in `@font-face`.
2. Font matching in the font cache can return templates and
`FontGroupFamily` can own mulitple templates. This is due to needing
support for "composite fonts". These are `@font-face` declarations
that only differ in their `unicode-range` definition.
This fixes a lot of non-determinism in font selection especially when
dealing with pages that define "composite faces." A notable example of
such a page is servo.org, which now consistently displays the correct
web font.
One test starts to fail due to an uncovered bug, but this will be fixed
in a followup change.
Fixes #20686.
Fixes #20684.
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'components/gfx/platform/windows/font.rs')
-rw-r--r-- | components/gfx/platform/windows/font.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/components/gfx/platform/windows/font.rs b/components/gfx/platform/windows/font.rs index 4930e9f7132..44300da9d5f 100644 --- a/components/gfx/platform/windows/font.rs +++ b/components/gfx/platform/windows/font.rs @@ -186,11 +186,7 @@ impl PlatformFontMethods for PlatformFont { StyleFontStyle::NORMAL }; - FontTemplateDescriptor { - weight, - stretch, - style, - } + FontTemplateDescriptor::new(weight, stretch, style) } fn glyph_index(&self, codepoint: char) -> Option<GlyphId> { |