From 56b41fa2eafac7e4a13695c0550d767a1da891ad Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 7 Oct 2016 18:12:51 -0700 Subject: [PATCH] gfx: On the Mac, take the scale into account when determining the x-height of a font. --- components/gfx/platform/macos/font.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/gfx/platform/macos/font.rs b/components/gfx/platform/macos/font.rs index 97def364161..adbaccf3c50 100644 --- a/components/gfx/platform/macos/font.rs +++ b/components/gfx/platform/macos/font.rs @@ -306,7 +306,7 @@ impl FontHandleMethods for FontHandle { .map(Au::from_f64_px) .unwrap_or(max_advance_width); - let metrics = FontMetrics { + let metrics = FontMetrics { underline_size: au_from_pt(self.ctfont.underline_thickness() as f64), // TODO(Issue #201): underline metrics are not reliable. Have to pull out of font table // directly. @@ -317,7 +317,7 @@ impl FontHandleMethods for FontHandle { strikeout_size: Au(0), // FIXME(Issue #942) strikeout_offset: Au(0), // FIXME(Issue #942) leading: au_from_pt(leading), - x_height: au_from_pt(self.ctfont.x_height() as f64), + x_height: au_from_pt((self.ctfont.x_height() as f64) * scale), em_size: em_size, ascent: au_from_pt(ascent * scale), descent: au_from_pt(descent * scale),