aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-06-15 15:42:38 -0700
committerGitHub <noreply@github.com>2017-06-15 15:42:38 -0700
commit8fd7dc80c40440b88f42b8f1036ef67483dd93f0 (patch)
tree1b6bc8536f643d244a874a5787266fc8be1c69f8
parent0142d193a3fde057718612028d9c1676e046b816 (diff)
parentead828d992c411b61594cb91400e9f6f26772bfe (diff)
downloadservo-8fd7dc80c40440b88f42b8f1036ef67483dd93f0.tar.gz
servo-8fd7dc80c40440b88f42b8f1036ef67483dd93f0.zip
Auto merge of #17340 - hinaria:master, r=jdm
windows: fix line height handling hi there! on windows, this change properly scales a font's line height by its size. previously, line height was not scaled to the font's size at all, which meant line heights become worse and worse the further you scaled away from the font's design size (in either direction, larger or smaller). this change makes the `line_gap` ratio and size scale with the font size. i've hand checked that the new computed `line_gap` matches the effective heights in chrome and firefox when `line-height = normal` for a bunch of system fonts. (servo's rendering quality on windows is a different story, though). ![demonstration](https://user-images.githubusercontent.com/975570/27185401-8e27023a-5228-11e7-8475-9e4223730d25.png) i believe this also solves #16476. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17340) <!-- Reviewable:end -->
-rw-r--r--components/gfx/platform/windows/font.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/gfx/platform/windows/font.rs b/components/gfx/platform/windows/font.rs
index 6046a70770f..5746739a107 100644
--- a/components/gfx/platform/windows/font.rs
+++ b/components/gfx/platform/windows/font.rs
@@ -372,7 +372,7 @@ impl FontHandleMethods for FontHandle {
descent: au_from_du_s(dm.descent as i32),
max_advance: au_from_pt(0.0), // FIXME
average_advance: au_from_pt(0.0), // FIXME
- line_gap: au_from_du((dm.ascent + dm.descent + dm.lineGap as u16) as i32),
+ line_gap: au_from_du_s((dm.ascent + dm.descent + dm.lineGap as u16) as i32),
};
debug!("Font metrics (@{} pt): {:?}", self.em_size * 12., metrics);
metrics