Specific Fonts look different with Skia

RESOLVED FIXED in Firefox 51

Status

()

Core
Graphics: Text
RESOLVED FIXED
9 months ago
8 months ago

People

(Reporter: mchang, Assigned: mchang)

Tracking

({regression})

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

Firefox Tracking Flags

(firefox50 unaffected, firefox51 fixed)

Details

(Whiteboard: [gfx-noted])

Attachments

(4 attachments)

(Assignee)

Description

9 months ago
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

9 months ago
Created attachment 8787339 [details]
Small Test case
(Assignee)

Comment 2

9 months ago
Created attachment 8787340 [details]
Skia rendering Segoe UI
(Assignee)

Comment 3

9 months ago
Created attachment 8787341 [details]
Cairo rendering Segoe UI
(Assignee)

Comment 4

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

Comment 5

9 months 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

9 months ago
Blocks: 1300025

Updated

9 months ago
No longer blocks: 1300025
(Assignee)

Comment 6

9 months 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

9 months ago
See Also: → bug 1299985
[Tracking Requested - why for this release]: Regresion
status-firefox50: --- → unaffected
tracking-firefox51: --- → ?
(Assignee)

Comment 8

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

Comment 9

9 months 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

9 months 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

9 months ago
Created attachment 8790506 [details] [diff] [review]
Force GDI Type rendering with Skia

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

9 months 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

9 months 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 ;-)

Updated

8 months ago
Attachment #8790506 - Flags: review?(lsalzman) → review+
(Assignee)

Comment 14

8 months ago
Try - https://treeherder.mozilla.org/#/jobs?repo=try&revision=77e909db7bc9

Comment 15

8 months 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

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/72d223d9dec0
Status: ASSIGNED → RESOLVED
Last Resolved: 8 months ago
status-firefox51: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
No need to track for 51 as this is fixed.
tracking-firefox51: ? → ---

Comment 18

8 months 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

8 months 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

8 months 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.