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

BackstopJS font rendering consistency #258

Closed
reneroth opened this issue Jan 12, 2017 · 6 comments
Closed

BackstopJS font rendering consistency #258

reneroth opened this issue Jan 12, 2017 · 6 comments
Assignees
Labels

Comments

@reneroth
Copy link
Contributor

reneroth commented Jan 12, 2017

The font rendering seems to be highly dependent on the user's personal settings - see the difference in font rendering with LCD smoothing (left) and without:
screenshot 2017-01-12 um 14 11 58

Changing the settings on my computer resolved the problem for the most part, but there are still minor differences:
screenshot 2017-01-12 um 14 57 28
screenshot 2017-01-12 um 14 59 20

Darren and I made sure to use both the same versions of all dependencies, as well as the same font files (Helvetica).

@reneroth reneroth added the bug label Jan 12, 2017
@planktonic
Copy link
Member

To investigate: any chance CSS -webkit-font-smoothing overrides the system setting?

@reneroth
Copy link
Contributor Author

see this:

garris/BackstopJS#361 (comment)

@planktonic
Copy link
Member

planktonic commented Jan 16, 2017

I didn't have any luck setting the webfont smoothing in an onBefore event as suggested in that thread, but setting it in css worked (on html, in base/_typography.scss) i.e. re-built the reference images with -webkit-font-smoothing set to none, then changing the system option on macOS for font-smoothing had no effect on tests — all tests passed when run with npm run test.

TODO: check if the same is true for the default value of subpixel-antialiased, then no changes to reference images are necessary.

We don’t want this to be part of the css output of course, so maybe add this one-liner to styleguide-extras.scss and rebuild all the test images. Could be worth doing this as part of #256 as that changed a lot of reference images due to changed typography — it would minimise the repo size due to image rewriting.

We should also check on branch (before merging to master) that it works as expected between macs, and ideally between platforms — as mentioned in that other thread, font-rendering on e.g. linux is very different, ideally this project is as cross-platform as possible.

@reneroth
Copy link
Contributor Author

if minimizing repo size is a concern, let's run pngcrush or something similar over the reference file.
On a quick test, it loslessly crushed their size from 4.7MB to 3.2MB

@planktonic
Copy link
Member

I meant more the fact that git stores the entire history of a file — changing large files often is expensive (also means crushing the reference images now will make the repo larger!).

@planktonic planktonic self-assigned this Jan 17, 2017
reneroth pushed a commit that referenced this issue Jan 19, 2017
-webkit-font-smoothing is set to none for all BackstopJS tests
Error threshold has been increased to 0.15 from 0.1 to account for minor differences among OS
@planktonic
Copy link
Member

fixed by #256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants