mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
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>
This commit is contained in:
parent
e9e46f4c0b
commit
5393d30a8e
9 changed files with 71 additions and 80 deletions
|
@ -16,9 +16,9 @@ use style::properties::style_structs::Font as FontStyleStruct;
|
|||
use style::values::computed::font::FontWeight;
|
||||
use webrender_api::NativeFontHandle;
|
||||
|
||||
use crate::font::FontHandleMethods;
|
||||
use crate::font::PlatformFontMethods;
|
||||
use crate::font_cache_thread::FontIdentifier;
|
||||
use crate::platform::font::FontHandle;
|
||||
use crate::platform::font::PlatformFont;
|
||||
|
||||
/// A reference to a [`FontTemplate`] with shared ownership and mutability.
|
||||
pub(crate) type FontTemplateRef = Rc<RefCell<FontTemplate>>;
|
||||
|
@ -191,10 +191,10 @@ impl FontTemplateRefMethods for FontTemplateRef {
|
|||
return Err("Invalid font template");
|
||||
}
|
||||
|
||||
let handle = FontHandleMethods::new_from_template(self.clone(), None);
|
||||
let handle = PlatformFontMethods::new_from_template(self.clone(), None);
|
||||
let mut template = self.borrow_mut();
|
||||
template.is_valid = handle.is_ok();
|
||||
let handle: FontHandle = handle?;
|
||||
let handle: PlatformFont = handle?;
|
||||
template.descriptor = Some(FontTemplateDescriptor::new(
|
||||
handle.boldness(),
|
||||
handle.stretchiness(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue