chore: fix warnings for Windows-specific fonts code (#37063)

Fix warnings from `components/fonts/platform/windows/font.rs` and
`components/fonts/platform/windows/font_list.rs` due to deprecations
from dwrote.

Testing: none, should behave as it did before

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Ashwin Naren 2025-05-21 09:30:43 -07:00 committed by GitHub
parent 856ffa6ecb
commit cebb1619ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 7 deletions

View file

@ -132,7 +132,9 @@ impl PlatformFontMethods for PlatformFont {
pt_size: Option<Au>,
) -> Result<PlatformFont, &'static str> {
let font_face = FontCollection::system()
.get_font_from_descriptor(&font_identifier.font_descriptor)
.font_from_descriptor(&font_identifier.font_descriptor)
.ok()
.flatten()
.ok_or("Could not create Font from descriptor")?
.create_font_face();
Self::new(font_face, pt_size)