diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-04-17 19:44:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 17:44:34 +0000 |
commit | 5393d30a8eb92f0a62ca37bb1486927fdf3604ff (patch) | |
tree | 6702ced909c9c5c0de3d1df243c26810bbba4518 /components/gfx/tests/font_context.rs | |
parent | e9e46f4c0bf54c9ed1ba70c33cc9bcfe33c5e1c7 (diff) | |
download | servo-5393d30a8eb92f0a62ca37bb1486927fdf3604ff.tar.gz servo-5393d30a8eb92f0a62ca37bb1486927fdf3604ff.zip |
Simplify `FontHandle` and rename it to `PlatformFont` (#32101)
* Simplify `FontHandle` and rename it to `PlatformFont`
Rename it to `PlatformFont` and move the `FontTemplate` member to
`Font`, because it's shared by all platforms.
* Update components/gfx/platform/freetype/font.rs
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
* Fix build for MacOS and Windows
---------
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
Diffstat (limited to 'components/gfx/tests/font_context.rs')
-rw-r--r-- | components/gfx/tests/font_context.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/components/gfx/tests/font_context.rs b/components/gfx/tests/font_context.rs index 8e8de147d3e..6a787ae9996 100644 --- a/components/gfx/tests/font_context.rs +++ b/components/gfx/tests/font_context.rs @@ -11,8 +11,7 @@ use std::rc::Rc; use app_units::Au; use gfx::font::{ - fallback_font_families, FontDescriptor, FontFamilyDescriptor, FontFamilyName, - FontHandleMethods, FontSearchScope, + fallback_font_families, FontDescriptor, FontFamilyDescriptor, FontFamilyName, FontSearchScope, }; use gfx::font_cache_thread::{FontIdentifier, FontTemplateAndWebRenderFontKey, FontTemplates}; use gfx::font_context::{FontContext, FontSource}; @@ -176,7 +175,7 @@ fn test_font_group_find_by_codepoint() { .find_by_codepoint(&mut context, 'a') .unwrap(); assert_eq!( - font.borrow().handle.template().borrow().identifier, + font.borrow().template.borrow().identifier, TestFontSource::identifier_for_font_name("csstest-ascii") ); assert_eq!( @@ -190,7 +189,7 @@ fn test_font_group_find_by_codepoint() { .find_by_codepoint(&mut context, 'a') .unwrap(); assert_eq!( - font.borrow().handle.template().borrow().identifier, + font.borrow().template.borrow().identifier, TestFontSource::identifier_for_font_name("csstest-ascii") ); assert_eq!( @@ -204,7 +203,7 @@ fn test_font_group_find_by_codepoint() { .find_by_codepoint(&mut context, 'á') .unwrap(); assert_eq!( - font.borrow().handle.template().borrow().identifier, + font.borrow().template.borrow().identifier, TestFontSource::identifier_for_font_name("csstest-basic-regular") ); assert_eq!(count.get(), 2, "both fonts should now have been loaded"); @@ -225,7 +224,7 @@ fn test_font_fallback() { .find_by_codepoint(&mut context, 'a') .unwrap(); assert_eq!( - font.borrow().handle.template().borrow().identifier, + font.borrow().template.borrow().identifier, TestFontSource::identifier_for_font_name("csstest-ascii"), "a family in the group should be used if there is a matching glyph" ); @@ -235,7 +234,7 @@ fn test_font_fallback() { .find_by_codepoint(&mut context, 'á') .unwrap(); assert_eq!( - font.borrow().handle.template().borrow().identifier, + font.borrow().template.borrow().identifier, TestFontSource::identifier_for_font_name("csstest-basic-regular"), "a fallback font should be used if there is no matching glyph in the group" ); |