mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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
|
@ -14,7 +14,6 @@ use font_kit::font::Font;
|
|||
use font_kit::metrics::Metrics;
|
||||
use font_kit::properties::{Properties, Stretch, Style, Weight};
|
||||
use font_kit::source::SystemSource;
|
||||
use gfx::font::FontHandleMethods;
|
||||
use gfx::font_cache_thread::FontCacheThread;
|
||||
use gfx::font_context::FontContext;
|
||||
use gfx::font_template::FontTemplateRefMethods;
|
||||
|
@ -502,7 +501,7 @@ impl<'a> CanvasData<'a> {
|
|||
.first(font_context)
|
||||
.expect("couldn't find font");
|
||||
let font = font.borrow_mut();
|
||||
Font::from_bytes(font.handle.template().data(), 0)
|
||||
Font::from_bytes(font.template.data(), 0)
|
||||
.ok()
|
||||
.or_else(|| load_system_font_from_style(Some(style)))
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue