Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: fix line height handling #17340

Merged
merged 1 commit into from Jun 15, 2017
Merged

windows: fix line height handling #17340

merged 1 commit into from Jun 15, 2017

Conversation

@hinaria
Copy link
Contributor

hinaria commented Jun 15, 2017

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

i believe this also solves #16476.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors

This change is Reviewable

@highfive
Copy link

highfive commented Jun 15, 2017

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @asajeffrey (or someone else) soon.

@highfive
Copy link

highfive commented Jun 15, 2017

warning Warning warning

  • These commits modify gfx code, but no tests are modified. Please consider adding a test!
@stshine
Copy link
Contributor

stshine commented Jun 15, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Jun 15, 2017

Trying commit ead828d with merge 2554198...

bors-servo added a commit that referenced this pull request Jun 15, 2017
windows: fix line height handling

hi there!

on windows, this change properly scales a font's line height by its size. before, this was not being done at all, which resulted in super ugly text at larger em sizes.

![demonstration](https://user-images.githubusercontent.com/975570/27185401-8e27023a-5228-11e7-8475-9e4223730d25.png)

i'm not sure what to do about tests: i wasn't able to find any similar tests, and the previous change (#16034) did not include any tests either.

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 -->
@jdm
Copy link
Member

jdm commented Jun 15, 2017

@stshine Not sure that a try build is very meaningful, since we don't run tests on Windows.

@jdm
Copy link
Member

jdm commented Jun 15, 2017

@jonathandturner Are you able to try this out?

@stshine
Copy link
Contributor

stshine commented Jun 15, 2017

@jdm whoops, my bad.

@bors-servo
Copy link
Contributor

bors-servo commented Jun 15, 2017

@atouchet
Copy link
Contributor

atouchet commented Jun 15, 2017

I tested this PR out and it appears to fix the spacing issues on Hacker News as well. Looks good!

@jonathandturner
Copy link

jonathandturner commented Jun 15, 2017

@jdm - building it now

@jonathandturner
Copy link

jonathandturner commented Jun 15, 2017

Hmmm, looks like my main computer (which is getting repaired as we speak) has my working Windows Servo environment. Seeing if I can put another one together

@jonathandturner
Copy link

jonathandturner commented Jun 15, 2017

Apologies for the delay. Initial testing looks good. Agreed that I don't see the issue with #16476 anymore. Other sites, like Hacker News and reddit, look okay.

@jdm - I'd say we're good.

@jdm
Copy link
Member

jdm commented Jun 15, 2017

@bors-servo: r+
Thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Jun 15, 2017

📌 Commit ead828d has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jun 15, 2017

Testing commit ead828d with merge 8fd7dc8...

bors-servo added a commit that referenced this pull request Jun 15, 2017
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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 15, 2017

@bors-servo bors-servo merged commit ead828d into servo:master Jun 15, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants
You can’t perform that action at this time.