gfx: On the Mac, take the scale into account when determining the

x-height of a font.
This commit is contained in:
Patrick Walton 2016-10-07 18:12:51 -07:00
parent 7bf06ed459
commit 56b41fa2ea

View file

@ -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),