Closed Bug 1260454 Opened 8 years ago Closed 8 years ago

Nightly: Suspected -moz-osx-font-smoothing: greyscale regression causing "fat" fonts on OS X

Categories

(Core :: Graphics: Text, defect)

48 Branch
Unspecified
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox47 --- unaffected
firefox48 --- fixed

People

(Reporter: spam, Assigned: mchang)

References

Details

(Keywords: regression, Whiteboard: [gfx-noted])

Attachments

(6 files)

Attached image firefox-fat-fonts.png (deleted) —
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36

Steps to reproduce:

Long-time Nightly (Deer Park, Minefield, Aurora) user, rare reporter. :)

From what I can tell, it appears that the CSS -moz-osx-font-smoothing rule has stopped working in Nightly on OS X 10.11.3 (El Capitan.)

I noted text rendering in Yahoo! Mail changed recently in Nightly on OS X - the text for the inbox list seemed to be thicker, more dark than previously. I assumed they had changed their layout, but then I also noted white text on dark backgrounds especially looked "fat", more thick than usual when on dark backgrounds on Slack and elsewhere.


Actual results:

Screenshot below shows part of one of the signed-out slack.com homepages which uses light text on a dark background. We use -moz-osx-font-smoothing: greyscale in our CSS so text looks "nicer" on the homepage and in the slack.com web client, and more closely matches the rendering of Safari and Chrome on OS X.

Nightly and "production" Firefox are shown here.
https://www.flickr.com/photos/schill/25821239490/


Expected results:

In the screenshot, I expected text to be "thinner" like in current, production Firefox releases.
https://www.flickr.com/photos/schill/25821239490/
Component: Untriaged → Graphics: Text
Product: Firefox → Core
@hkuey kindly asked for this to be filed under Core::Layout:Text - sorry, didn't see it in the component list.

https://twitter.com/khuey_/status/714830076915818496
> 27:55.23 INFO: Last good revision: 9873db170eaa08b203fd39fbf8f02fcb8358a10e
> 27:55.23 INFO: First bad revision: 66ee9fcbbbd3f207c3fcc141aa2da12ca9534894
> 27:55.23 INFO: Pushlog:
> https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=9873db170eaa08b203fd39fbf8f02fcb8358a10e&tochange=66ee9fcbbbd3f207c3fcc141aa2da12ca9534894

> Looks like the following bug has the changes which introduced the regression:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1207332

Used mozregression to find the offending commit.

STR: Check https://slack.com/ to see if the text looks like the top (bad) or bottom (good) in Scott's photo.

Appears to be due to the enabling of Skia on OS X, so I'll block that bug.
Blocks: skia-osx
Status: UNCONFIRMED → NEW
Has Regression Range: --- → yes
Has STR: --- → yes
Ever confirmed: true
Keywords: regression
Whiteboard: [gfx-noted]
Assignee: nobody → mchang
Attached image Nightly left, Release on the right (deleted) —
Nightly w/ Skia on left, Release w/ CG on right. Skia seems to still adhere to the grayscale AA, but it's still a bit too thick.
Attached file Simple test case (deleted) —
Also with screenshot, top is with -moz-osx-font-smoothing, bottom without.
This was happening because we still enabled LCD font smoothing [1] with grayscale AA, which caused the larger font. This disables font smoothing with grayscale AA, which is what CG is doing. [2]

[1] https://dxr.mozilla.org/mozilla-central/source/gfx/skia/skia/src/ports/SkFontHost_mac.cpp?from=SkFontHost_mac.cpp#884
[2] https://dxr.mozilla.org/mozilla-central/source/gfx/2d/DrawTargetCG.cpp?from=DrawTargetCG.cpp#1544
Attachment #8743388 - Flags: review?(lsalzman)
Attachment #8743388 - Flags: review?(lsalzman) → review+
Attached patch Reftest fix with patch (deleted) — Splinter Review
Looks like we fixed bug 1152044 also. Canvas text by default does not have subpixel AA.
Attachment #8743895 - Flags: review?(lsalzman)
Attachment #8743895 - Flags: review?(lsalzman) → review+
Successful reftest try I think - https://treeherder.mozilla.org/#/jobs?repo=try&revision=f5984d96c0a5 - 10.6 just won't start :/.
https://hg.mozilla.org/mozilla-central/rev/887901e60313
https://hg.mozilla.org/mozilla-central/rev/b251f7795f18
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Depends on: 1267363
OS: Unspecified → Mac OS X
Could that be a problem in 48+ still?
That (In reply to Stefan Plewako [:stef] from comment #11)
> Created attachment 8761617 [details]
> headers as on https://www.splewako.com/log (47 above 48)

This screenshot shows two problems: The font size is light enough that CG would choose a thinned mask for the text, and Skia doesn't implement that color-based thinning (see bug 1230366 comment 35); that's why the small text at the top has become thicker. The problem with the large text underneath is bug 1263740: at a certain font size, Skia switches to drawing the text as a path. That's why the large text at the bottom has become thinner.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: