Specific Fonts look different with Skia

RESOLVED FIXED in Firefox 51

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: mchang, Assigned: mchang)

Tracking

({regression})

51 Branch
mozilla51
All
Windows
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox50 unaffected, firefox51 fixed)

Details

(Whiteboard: [gfx-noted])

Attachments

(4 attachments)

Skia on Windows 7 with Consolas and Segoe UI fonts specifically look thicker than when rendered with cairo.

Skia on Windows 10 with Courier New looks thinner. This I suspect would be related to GDI fonts vs DWrite and maybe not respecting the GDI tweaks here [1]

[1] http://searchfox.org/mozilla-central/source/modules/libpref/init/all.js#3364
(Assignee)

Comment 1

3 years ago
Posted file Small Test case
(Assignee)

Comment 4

3 years ago
I should know, Consolas and Segoe UI only look different with cleartype disabled system wide.

Comment 5

3 years ago
What about "Courier New"? I tried removing it from
gfx.font_rendering.cleartype_params.force_gdi_classic_for_families
but it didn't make a difference.

Updated

3 years ago
Blocks: 1300025

Updated

3 years ago
No longer blocks: 1300025
(Assignee)

Comment 6

3 years ago
(In reply to Jorg K (GMT+2, PTO during summer) from comment #5)
> What about "Courier New"? I tried removing it from
> gfx.font_rendering.cleartype_params.force_gdi_classic_for_families
> but it didn't make a difference.

Still looking.
(Assignee)

Updated

3 years ago
See Also: → 1299985
(Assignee)

Comment 8

3 years ago
This isn't going to ship in 51 and I'm not sure this is considered a real regression yet.
(Assignee)

Comment 9

3 years ago
I'm not sure this bug will fix the lightness issue, but it will solve some of the characters actually rendering differently with courier new. On a side note, found this https://bugs.chromium.org/p/chromium/issues/detail?id=356823  comment 20 - "On the positive side, Googling this bug lead me to learn that I should never, ever use courier/courier new ever and apparently God kills a kitten each time I do."

Comment 10

3 years ago
<off topic>
That will be a lot of dead cats then ;-( - I tried consolas, I don't like the "g". What's the font used here on BMO? Or on bugs.chromium.org?
</off topic>
(Assignee)

Comment 11

3 years ago
Cairo would force TEXT_RENDERING_GDI_CLASSIC [1] for specific fonts if we detected we should force GDI classic mode on some fonts [2]. This passes down that decision into Skia so that we can disable subpixel text positioning and enable bitmap fonts for these specific cases, which uses TEXT_RENDERING_GDI_CLASSIC as well [3].

[1] http://searchfox.org/mozilla-central/source/gfx/cairo/cairo/src/cairo-dwrite-font.cpp#1105
[2] http://searchfox.org/mozilla-central/source/gfx/thebes/gfxDWriteFontList.cpp#1001
[3] http://searchfox.org/mozilla-central/source/gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp#283
Attachment #8790506 - Flags: review?(lsalzman)
(Assignee)

Comment 12

3 years ago
(In reply to Jorg K (GMT+2, PTO during summer) from comment #10)
> <off topic>
> That will be a lot of dead cats then ;-( - I tried consolas, I don't like
> the "g". What's the font used here on BMO? Or on bugs.chromium.org?
> </off topic>

The font im seeing on BMO is "13px/1.2 "Droid Sans Mono", Menlo, Monaco, "Courier New", Courier, monospace"

Comment 13

3 years ago
Since I don't have "Droid Sans Mono", Menlo, Monaco (they are native to Linux, Mac, Mac), I'm producing a lot of dead cats ;-)
Attachment #8790506 - Flags: review?(lsalzman) → review+

Comment 15

3 years ago
Pushed by mchang@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/72d223d9dec0
Force GDI Classic rendering for specific fonts with skia on windows. r=lsalzman

Comment 16

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/72d223d9dec0
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
No need to track for 51 as this is fixed.

Comment 18

3 years ago
(In reply to Mason Chang PTO 10/3 [:mchang] from comment #6)
> (In reply to Jorg K (GMT+2, PTO during summer) from comment #5)
> > What about "Courier New"? I tried removing it from
> > gfx.font_rendering.cleartype_params.force_gdi_classic_for_families
> > but it didn't make a difference.
> Still looking.

Now that Skia has landed again for Windows and this bug has landed as well, I must say that "Courier New" still looks pretty bad when rendered with Skia, particularly the number "2" as detailed in bug 1007702 comment #19. I need to switch Skia off, since "Courier New" which is the *default* monospace font on Windows just looks so bad.

Any plans fixing this? If this gets shipped in FF release one day, you'll get and outcry.

Comment 19

3 years ago
Please ignore the previous comment. I tried with a FF Nightly and a TB Daily both on a new profile and "Courier New" looks thin but acceptable, just like in Chrome. No bad "2".

Note: When I wrote comment #18, I had some messed-up gfx.* preferences, so the "2" did look bad. After rectifying that, it's all good.

Thanks a lot for your work, patience and support!
Thanks Jorg - do you recall which of the gfx.* preferences caused the bad font display?

Comment 21

3 years ago
Yes, I had foolishly removed "Courier New" from gfx.font_rendering.cleartype_params.force_gdi_classic_for_families. I can't even remember why. It must have happened earlier on when I turned all possible screws to see what made a difference. I mentioned it in comment #5. Sorry about the confusion, it's all good now ;-)
You need to log in before you can comment on or make changes to this bug.