mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Fonts compute their own metrics using NativeFont.
This commit is contained in:
parent
e28827d1c0
commit
54f1e83844
2 changed files with 5 additions and 3 deletions
|
@ -75,6 +75,7 @@ pub impl Font : FontMethods {
|
|||
ascent: em_size.scale_by(em_ascent),
|
||||
descent: em_size.scale_by(em_descent),
|
||||
};
|
||||
|
||||
return metrics;
|
||||
}
|
||||
|
||||
|
@ -96,7 +97,9 @@ pub impl Font : FontMethods {
|
|||
|
||||
// TODO: font should compute its own metrics using native_font.
|
||||
// TODO: who should own fontbuf?
|
||||
fn Font(lib: @FontCache, fontbuf: @~[u8], native_font: NativeFont, metrics: FontMetrics) -> Font {
|
||||
fn Font(lib: @FontCache, fontbuf: @~[u8], native_font: NativeFont) -> Font {
|
||||
let metrics = native_font.get_metrics();
|
||||
|
||||
Font {
|
||||
lib: lib,
|
||||
fontbuf : fontbuf,
|
||||
|
|
|
@ -44,8 +44,7 @@ fn create_font(lib: @FontCache, native_lib: &native::NativeFontCache) -> Result<
|
|||
} else {
|
||||
return Err(native_font.get_err());
|
||||
};
|
||||
let metrics = native_font.get_metrics();
|
||||
return Ok(@Font(lib, font_bin, native_font, metrics));
|
||||
return Ok(@Font(lib, font_bin, native_font));
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue