Open Bug 1855786 Opened 2 years ago

Change the default order of fonts for zk-HK and zk-TW

Categories

(Core :: Layout: Text and Fonts, enhancement)

enhancement

Tracking

()

People

(Reporter: tjr, Unassigned)

Details

The very detailed report at https://www.reddit.com/r/firefox/comments/16thnb3/font_fingerprinting_protection_in_firefox_118s/ describes how our default order of fonts for these locales put harder-to-read fonts first, and that this is the opposite of Windows behavior which moved the easier-to-read fonts first.

Note that while the topic of the post is initially about the Font Fingerprinting Protections, that is because the user had custom settings that overrode our bad defaults and they would like to go back to their customizations.

I'm going to copy/paste the most important bits in case the reddit thread goes away:

The screenshot, from top to bottom, shows how the sidebar text is shown when the highest priority is set to Japanese, Traditional Chinese (HK), and Korean. Because Korean has a more limited character set, the text will fallback a second time to another when the glyph is missing (as seen with 関 and 国 in the screenshot). The default traditional Chinese fonts (MingLiU_HKSCS and PMingLiU) are significantly harder to read at small sizes due to them being serif fonts. Windows has changed this default font to a sans-serif font (Microsoft JhengHei) since Windows Vista but Firefox continues to use the old default.

...

The normal behaviour for me was indeed using locally installed custom fonts. This allowed misidentified CJK text to look consistent with each other by using a pan-CJK font like Source Han Sans or Noto Sans CJK is used. On a fully stock install of Firefox (both on 118 and on prior versions), the normal behaviour is the same as using the protection as in both cases the defaults are used as defined by font.name-list.sans-serif.[lang]. Where [lang] is ja, ko, or zh-CN, this preference does list the respective sans-serif font as used in Windows first and do not cause any problems. However, where [lang] is zh-HK or zh-TW, the list is in a peculiar order that make it hard to read.

For example, font.name-list.sans-serif.zh-HK by default lists "Arial, MingLiU_HKSCS, Ming(for ISO10646), MingLiU, MingLiU_HKSCS-ExtB, Microsoft JhengHei". Arial being listed first (or even listed at all) for these languages does not make sense as it does not have the character set to support the languages. Characters not available in the first font (which is practically all of them) fallback to the next font, which is MingLiU_HKSCS. This still should not have been the choice for this preference as this is a serif font. The only sans-serif font in this list is listed at the end but because the preceding fonts have a more extensive character set, it is never used.

If you are passing this along to those involved, this problem can be mitigated when this list is set properly, where the actual sans-serif font is moved to the front. I changed the preference font.name-list.sans-serif.zh-HK to "Microsoft JhengHei, MingLiU_HKSCS, Ming(for ISO10646), MingLiU, MingLiU_HKSCS-ExtB" and font.name-list.sans-serif.zh-TW to "Microsoft JhengHei, PMingLiU, MingLiU, MingLiU-ExtB" and even without using the -FontVisibilityLangPack flag (and therefore retaining the protection), small text remains readable as now the proper sans-serif font consistent with Windows UI defaults are used. Again, I do not understand how this list is generated, but this is the solution I could come by without overriding the feature. Similarly, Times New Roman should be removed as the first font for the serif variant lists for these two languages.

In my original post, I needed an override because the default traditional Chinese (zh-TW and zh-HK) fonts used for Firefox on Windows are serifed and hard to read. Otherwise, the font fingerprinting protection feature introduced in 118 works as intended.

You need to log in before you can comment on or make changes to this bug.