diff --git a/src/servo/text/font.rs b/src/servo/text/font.rs index c381322b934..2073161ec85 100644 --- a/src/servo/text/font.rs +++ b/src/servo/text/font.rs @@ -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, diff --git a/src/servo/text/font_cache.rs b/src/servo/text/font_cache.rs index 075a5cc66cf..a1d877bb8b0 100644 --- a/src/servo/text/font_cache.rs +++ b/src/servo/text/font_cache.rs @@ -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")]