mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
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).  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 -->
This commit is contained in:
commit
8fd7dc80c4
1 changed files with 1 additions and 1 deletions
|
@ -372,7 +372,7 @@ impl FontHandleMethods for FontHandle {
|
||||||
descent: au_from_du_s(dm.descent as i32),
|
descent: au_from_du_s(dm.descent as i32),
|
||||||
max_advance: au_from_pt(0.0), // FIXME
|
max_advance: au_from_pt(0.0), // FIXME
|
||||||
average_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);
|
debug!("Font metrics (@{} pt): {:?}", self.em_size * 12., metrics);
|
||||||
metrics
|
metrics
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue