Firefox is running in Clear Type mode by default

VERIFIED FIXED in Firefox 51

Status

()

Core
Graphics: Text
VERIFIED FIXED
11 months ago
7 months ago

People

(Reporter: Marty, Assigned: mchang)

Tracking

({regression})

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

Firefox Tracking Flags

(firefox50 unaffected, firefox51 verified)

Details

(Whiteboard: [gfx-noted])

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

11 months ago
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:51.0) Gecko/20100101 Firefox/51.0
Build ID: 20160826101718

Steps to reproduce:

In XP Firefox is running with clear type enabled by default. This despite the fact clear type is not enabled in Windows XP display settings. The result is blurry text on toolbars and websites.

Tested with a new profile and no addons.
(Reporter)

Comment 1

11 months ago
A temporary workaround to this bug is to remove Skia from "gfx.content.azure.backends". With that change clear type is disabled again.

Updated

11 months ago
QA Whiteboard: [bugday-20160829]
Component: Untriaged → Graphics: Text
Product: Firefox → Core

Updated

11 months ago
Whiteboard: [gfx-noted]

Updated

11 months ago
Blocks: 1007702
(Assignee)

Updated

11 months ago
Assignee: nobody → mchang
(Assignee)

Comment 2

11 months ago
Hi Marty,

Can you please try this build to see if it fixes the issue for you?

https://archive.mozilla.org/pub/firefox/try-builds/mchang@mozilla.com-4b3b8f8714e048d550925eab9cc434b5c2726dba/try-win32/firefox-51.0a1.en-US.win32.installer.exe

Thanks!
Flags: needinfo?(marty6001)
(Reporter)

Comment 3

11 months ago
Hello, no that build didn't change anything, it's still displaying Cleartype in both XP and Windows 7 with HWA disabled and skia added back to "gfx.content.azure.backends".

In comparison to 45esr side by side to the nightly if Cleartype is enabled in Display properties\Effects in XP both the nightly and 45 look exactly the same on the toolbars and website text. When Clearytype is disabled again then it's also disabled in 45 but not in the nightly unless skia is removed.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
status-firefox50: --- → unaffected
status-firefox51: --- → affected
Keywords: regression
(Assignee)

Updated

11 months ago
Flags: needinfo?(marty6001)
(Assignee)

Comment 4

11 months ago
Can you please try this one? It mostly looks the same for me on Windows 7. I don't have a Windows XP machine to test though :(.

Thanks!

https://archive.mozilla.org/pub/firefox/try-builds/mchang@mozilla.com-3eab9615414ad2ac8236f1062f150481734b4193/try-win32/firefox-51.0a1.en-US.win32.installer.exe
Flags: needinfo?(marty6001)

Updated

11 months ago
Blocks: 1299605
(Reporter)

Comment 5

11 months ago
Today's test build appears to fix it on the toolbars in XP and Windows 7 (they're both affected with HWA disabled) but website text is still in cleartype. Here are screenshots of 45esr and the nightly taken in Windows 7. You might want to download them to your desktop for a better comparison:

45esr:
https://postimg.org/image/h39xjiaod/

nightly:
https://postimg.org/image/vi9ly78j9/
(Assignee)

Comment 6

11 months ago
So it looks like the text on the sidebar on the right is the same but the other font on the left is not. Is that the case?
Flags: needinfo?(marty6001)
(Assignee)

Updated

11 months ago
Flags: needinfo?(marty6001)
(Reporter)

Comment 7

11 months ago
The whole page is cleartype, every one looks exactly as it does when cleartype is turned on through the OS, either in XP or Windows 7.
(Assignee)

Comment 8

11 months ago
Can you attach your about:support here please?
(Reporter)

Comment 9

11 months ago
Created attachment 8787045 [details]
Raw data from about:support

Here's the data from about:support as requested.
(Reporter)

Comment 10

11 months ago
Testing it today in XP it's not cleartype, there is a difference if that's enabled but in comparison to if skia is removed, which returns it completely to the prior state or to 45esr the text is larger and bolder on some pages and not on others.   

As long as skia can be removed and is not hard-coded then it's not so much of an issue although one would lose whatever benefit skia brings. For me, how the text looks and reads on the page is more important.
(Reporter)

Comment 11

11 months ago
To clarify the previous post: at least on my system yesterday's test build from comment 4 resolves this bug as it is no longer running in cleartype with skia enabled.
(Assignee)

Comment 12

11 months ago
(In reply to Marty from comment #11)
> To clarify the previous post: at least on my system yesterday's test build
> from comment 4 resolves this bug as it is no longer running in cleartype
> with skia enabled.

So does that mean comment 5 is invalid and the builds from comment 4 fix the issue for you (per comment 10)?
(Reporter)

Comment 13

11 months ago
(In reply to Mason Chang [:mchang] from comment #12)
> (In reply to Marty from comment #11)
> > To clarify the previous post: at least on my system yesterday's test build
> > from comment 4 resolves this bug as it is no longer running in cleartype
> > with skia enabled.
> 
> So does that mean comment 5 is invalid and the builds from comment 4 fix the
> issue for you (per comment 10)?

For XP yes, in that OS it is back to pre-skia with skia enabled. 

In Windows 7, which the comparison screenshots above can show it's not cleartype either but the text, particularly titles on web pages are larger and bolder. You would know if that's related to skia itself but in terms of this bug it's not running in cleartype mode anymore in either OS, at least for me. Can't say about any other OSs.
(Assignee)

Updated

11 months ago
Blocks: 1299903
(Assignee)

Comment 14

11 months ago
Created attachment 8787338 [details] [diff] [review]
Properly set Skia AA if cleartype is disabled system wide

Cairo and D2D were respecting system wide cleartype settings and disabling subpixel AA when cleartype was disabled. Let's do the same for Skia. Unfortunately we have to check everytime we render text since cleartype can be dynamically disabled.
Flags: needinfo?(marty6001)
Attachment #8787338 - Flags: review?(lsalzman)
(Assignee)

Comment 15

11 months ago
Comment on attachment 8787338 [details] [diff] [review]
Properly set Skia AA if cleartype is disabled system wide

Might actually want to do something different here with regard to hinting and cleartype.
Attachment #8787338 - Flags: review?(lsalzman)

Updated

11 months ago
Attachment #8787338 - Flags: review+
(In reply to Mason Chang [:mchang] from comment #15)
> Comment on attachment 8787338 [details] [diff] [review]
> Properly set Skia AA if cleartype is disabled system wide
> 
> Might actually want to do something different here with regard to hinting
> and cleartype.

r+ but with one nit...

Nit: Since GetDefaultAAMode() can be expensive to call because it may be doing system calls, maybe do like:
AntialiasMode defaultAA = aFont->GetDefaultAAMode();
AntialiasMode aaMode = defaultAA;
...

That way you have defaultAA around already rather than needing to call that again to get it down in the GDI case. Also gets rid of the need to brace that case as well. Reduce, reuse, recycle. ;)
(Assignee)

Comment 17

11 months ago
At least with Segoe UI and cleartype disabled, there are a couple of interesting observations. Compared to Segoe UI at size 14 pt in notepad, only cairo actually looks like notepad. Chrome, Firefox w/D2D1.1, and IE all are slightly thinner than what we see in notepad. Skia in Firefox looks thicker than notepad.

I think what Chrome is doing, is rendering the font as cleartype then converting it back to grayscale when cleartype is disabled. If we do this in Firefox, we look like Chrome, which also looks like IE on Windows 7. Cairo with cleartype disabled actually looks overly thin compared to IE / Chrome.

I think the question then is, with cleartype disabled, do we want to be the outlier or should we make skia look like chrome / IE? Right now, Cairo and D2D look different depending on the font / website. Some fonts are bigger, some are smaller already, so they aren't already equal. If we go the route of rendering in cleartype then converting to grayscale, we look more in line with d2d than we do with cairo, albeit still different than Chrome /IE. With this, we also look more like IE / Chrome.

As for why the difference between cairo and skia on this font, I'm still not really sure. Doing anything other than normal hinting makes skia render the glyph as a path. Changing the quality parameter in the logfont doesn't seem to do anything either.

If we don't have a strong reason, I think the proper route here is to make Skia w/o cleartype look like IE / Chrome, which looks better than our currently overly thin fonts.

Comment 18

11 months ago
(In reply to Mason Chang [:mchang] from comment #17)
> If we don't have a strong reason, I think the proper route here is to make
> Skia w/o cleartype look like IE / Chrome, which looks better than our
> currently overly thin fonts.

That "overly thin" or sharp look used to be the standard on Windows. I think it's pretty much what users disabling ClearType expect. Why would anyone disable ClearType in order to get grayscale AA?
(Assignee)

Comment 19

11 months ago
(In reply to Dão Gottwald [:dao] from comment #18)
> (In reply to Mason Chang [:mchang] from comment #17)
> > If we don't have a strong reason, I think the proper route here is to make
> > Skia w/o cleartype look like IE / Chrome, which looks better than our
> > currently overly thin fonts.
> 
> That "overly thin" or sharp look used to be the standard on Windows. I think
> it's pretty much what users disabling ClearType expect. Why would anyone
> disable ClearType in order to get grayscale AA?

Disabling cleartype actually gives you grayscale AA instead of subpixel AA. That's the only reason to disable cleartype. [1]

[1] https://en.wikipedia.org/wiki/ClearType

Comment 20

11 months ago
It's been a few years since I toyed with cleartype... that was on Windows XP and I'm 99% sure not using cleartype (the default on XP) disabled all AA. Apparently this bug was also filed for XP.

I suppose DirectWrite behaves differently than GDI?
(Assignee)

Comment 21

11 months ago
(In reply to Dão Gottwald [:dao] from comment #20)
> It's been a few years since I toyed with cleartype... that was on Windows XP
> and I'm 99% sure not using cleartype (the default on XP) disabled all AA.
> Apparently this bug was also filed for XP.
> 
> I suppose DirectWrite behaves differently than GDI?

Could be something unique to Windows XP. On Windows 7, all system wide fonts in all applications have grayscale AA.
(Assignee)

Comment 22

11 months ago
Created attachment 8787676 [details] [diff] [review]
Use cleartype then convert to grayscale AA if cleartype is disabled

This patch always renders the font as cleartype then converts it to grayscale AA, which makes Firefox on Windows 7 look ~= IE and Chrome. Now we also don't have to check the default AA in the GDI case also!

Also, cairo selectively applies grayscale AA with cleartype off. So sometimes its on, sometimes its off. This could be a GDI / Dwrite thing as at least system wide, every other application applies grayscale AA.
Attachment #8787338 - Attachment is obsolete: true
Attachment #8787676 - Flags: review+
(Reporter)

Comment 23

11 months ago
One question regarding the patch in Comment 22: will the option to remove skia remain because I prefer the Cairo fonts? They look exactly on Windows 7 as XP and are very readable and friendly to the eyes. IE11 not so much.
(Assignee)

Comment 24

11 months ago
Try looks good - https://treeherder.mozilla.org/#/jobs?repo=try&revision=656204bba02c&selectedJob=26858881

Comment 25

11 months ago
Pushed by mchang@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/88222d0a9266
Use cleartype and convert to grayscale AA for skia windows fonts if cleartype is disabled system wide. r=lsalzman
(Assignee)

Comment 26

11 months ago
(In reply to Marty from comment #23)
> One question regarding the patch in Comment 22: will the option to remove
> skia remain because I prefer the Cairo fonts? They look exactly on Windows 7
> as XP and are very readable and friendly to the eyes. IE11 not so much.

It will for a while but not in the long term. I might add a pref to disable all anti aliasing to help you, but it will still look slightly different than cairo fonts. Just for confirmation though, are the fonts different system wide versus what we have in Firefox for you in both Windows XP and 7? I've only been able to test with Windows 7. Thanks!
Flags: needinfo?(marty6001)
(Assignee)

Updated

11 months ago
See Also: → bug 1299985
(Reporter)

Comment 27

11 months ago
In XP Firefox and IE8 look very similar with cleartype disabled and I can't tell the difference system wide unless cleartype is enabled. The main problem for me with that is the blurriness. 

With IE11 it's grayscale with DirectWrite correct? That too is blurry and difficult to read at times. You will find countless numbers of people with the same complaints. Firefox still provides an alternative to disable all that and return to the standard font view. So it would help very much to include the added pref, it would alleviate a lot of potential problems, even if it's a bit different from cairo.

Comment 28

11 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/88222d0a9266
Status: ASSIGNED → RESOLVED
Last Resolved: 11 months ago
status-firefox51: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
when this patch landed Talos showed an improvement:
== Change summary for alert #2962 (as of September 02 2016 15:30 UTC) ==

Improvements:

  3%  tp5o Private Bytes windowsxp opt     212120228.54 -> 205265250.74
  3%  tp5o Private Bytes windowsxp pgo     210062013.79 -> 203642563.05
  3%  tp5o Main_RSS windowsxp opt          230403775.13 -> 223720605.02
  3%  tp5o Main_RSS windowsxp pgo          227249695.56 -> 221198154.63

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=2962
(Assignee)

Updated

11 months ago
Blocks: 1298608
(Assignee)

Comment 30

11 months ago
Marty, how are your fonts looking with this patch now? Thanks!
Flags: needinfo?(marty6001)
(Assignee)

Updated

11 months ago
Flags: needinfo?(marty6001)
(Reporter)

Comment 31

11 months ago
(In reply to Mason Chang [:mchang] from comment #30)
> Marty, how are your fonts looking with this patch now? Thanks!

It's a little blurry for me but not nearly as bad as IE11. After experimenting with fonts I found that changing Sarif to Book Antiqua works good. But I do still hope the option is added to disable AA altogether.
(Assignee)

Updated

11 months ago
Flags: needinfo?(marty6001)
Flags: qe-verify+
I've managed to reproduce this issue on an old Nightly build from 2016.08.26.

I can confirm the fix using 51 beta 10 (20161222080852) under Windows XP, SP3. The texts on websites and toolbars looks good to me. Marking here accordingly.
Status: RESOLVED → VERIFIED
status-firefox51: fixed → verified
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.