aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx/font_cache_thread.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-04-23 15:27:32 +0200
committerGitHub <noreply@github.com>2024-04-23 13:27:32 +0000
commitde47dfe5c106984efb996fe0989d59180187624f (patch)
tree5988eb86b4f89277bdd491e02bada69e17787e31 /components/gfx/font_cache_thread.rs
parent7ca920927c7e5f25e59557f825c4774381750e01 (diff)
downloadservo-de47dfe5c106984efb996fe0989d59180187624f.tar.gz
servo-de47dfe5c106984efb996fe0989d59180187624f.zip
fonts: Merge multiple methods into `PlatformFont::descriptor()` (#32115)
This combines `style()`, `boldness()`, `stretchiness()` into a `descriptor()` method which is used when creating `FontTemplate`s for web fonts. Eventually this method will simply read font tables using skrifa. This is the first step. In addition, `family_name()` and `face_name()` are removed. They were only used for debugging and the `FontIdentifier` serves for that. On Windows, this was adding another way in which font loading could fail, without buying us very much. The path or URL to the font is more important when debugging than the names in the font tables. Closes #15103. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because they should not change observable behavior. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Diffstat (limited to 'components/gfx/font_cache_thread.rs')
-rw-r--r--components/gfx/font_cache_thread.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/components/gfx/font_cache_thread.rs b/components/gfx/font_cache_thread.rs
index 303cabf3228..66f0708670d 100644
--- a/components/gfx/font_cache_thread.rs
+++ b/components/gfx/font_cache_thread.rs
@@ -260,12 +260,7 @@ impl FontCache {
return;
};
- let descriptor = FontTemplateDescriptor::new(
- handle.boldness(),
- handle.stretchiness(),
- handle.style(),
- );
-
+ let descriptor = handle.descriptor();
templates.add_template(FontTemplate::new_web_font(url, descriptor, data));
drop(result.send(()));
},