Closed Bug 1732629 Opened 3 years ago Closed 3 years ago

Bad font rendering in macOS Monterey on non-English systems

Categories

(Core :: Graphics: Text, defect, P1)

Firefox 92
defect

Tracking

()

VERIFIED FIXED
95 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox-esr91 94+ verified
firefox93 --- wontfix
firefox94 + verified
firefox95 + fixed

People

(Reporter: axelsarraille, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(12 files)

148.12 KB, image/png
Details
61.05 KB, image/png
Details
108.67 KB, image/png
Details
160.90 KB, image/png
Details
102.75 KB, image/png
Details
697.32 KB, image/png
Details
511.36 KB, image/png
Details
1.93 MB, image/png
Details
94.22 KB, image/png
Details
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
Attached image Firefox menu.png

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Firefox/92.0

Steps to reproduce:

Get macOS Monterey beta.
Open Firefox.

Actual results:

Font rendering of -apple-system font is cursed. It doesn't render different font weights and letterspacig is wrong. This happens both on the UI and CSS fonts on websites. This happens only on macOS Monterey, not in Big Sur or earlier versions.

Expected results:

Font weight should be properly displayed and letter spacing should be fine, not so stretched.

Attached image Adress bar.png
Attached image Wordpress on Chrome.png
Blocks: monterey
Status: UNCONFIRMED → NEW
Component: Untriaged → Graphics: Text
Ever confirmed: true
Flags: needinfo?(jfkthame)
Product: Firefox → Core

What model of Mac is this on? I believe we have some issues that are specific to the M1 Macs and Monterey.... would be good to confirm exactly what configuration is involved here. (FWIW, the font looks OK on my intel-based MacBook Pro running Monterey beta...)

Flags: needinfo?(jfkthame) → needinfo?(axelsarraille)

(In reply to Jonathan Kew (:jfkthame) from comment #4)

What model of Mac is this on? I believe we have some issues that are specific to the M1 Macs and Monterey.... would be good to confirm exactly what configuration is involved here. (FWIW, the font looks OK on my intel-based MacBook Pro running Monterey beta...)

Mine is Intel based, 2019 16-inch Macbook Pro

Flags: needinfo?(axelsarraille)

Interesting - that's exactly what mine is (16" MBPro, 2019), but I'm not seeing the bad system font rendering here. Maybe different OS versions? I'm currently on "12.0 Beta (21A5506j)", but it looks like there's an update available -- I'll try installing that later and see if anything changes.

(In reply to Jonathan Kew (:jfkthame) from comment #6)

Interesting - that's exactly what mine is (16" MBPro, 2019), but I'm not seeing the bad system font rendering here. Maybe different OS versions? I'm currently on "12.0 Beta (21A5506j)", but it looks like there's an update available -- I'll try installing that later and see if anything changes.

I'm on 21A5522h, but have had this bug since beta 1 (didn't report earlier because thought it was a macOS thing, but we're getting close to final :O). Also made a restore and new install of the OS and the bad font rendering is still there. :O

This is really strange -- for comparison, here's how the Firefox menu looks for me.

I have the same issue starting from Beta 1 (right now reproduced on 21A5534d) on MacBook Pro (15-inch, 2016). See attached screenshots from Safari and Firefox 93 for https://sparkmailapp.com/pricing site.

Attached image Safari

Safari

Attached image Firefox

Firefox

The severity field is not set for this bug.
:lsalzman, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(lsalzman)

I do not see this problem on macOS Monterey Beta 21A5552a on an M1 Macbook Pro.

Severity: -- → S3
Flags: needinfo?(lsalzman)

Still happens on final release of Monterrey, even did a new clean install to check.

Macbook air 2020 m1, just installed monterey update - can confirm that this terrible font rendering is here. Was using slightly outdated firefox, made sure to update to latest version and still looks terrible. I have m1 iMac whish I didn't update yet, so I can compare two interfaces side by side.

I get this problem too on Monterey

Comparison of the good font rendering to the bad/condensed rendering

This is probably the same issue with Thunderbird 91.2.1, too. Bad/condensed font rendering and e.g. unread mails are not highlighted with a bold font.

Attached image GitHub

macOS Monterey (12.0.1) was released yesterday and I can confirm the issue with a 2018 Intel-based MacBook Pro. It's especially noticeable on GitHub (GitHub uses system fonts) where the font is very different compared to Chrome now and where it's no longer possible to see bold fonts (like in mentions). This issue did not exist before the macOS update (macOS 11.6).

And yes, I can also confirm the previous comment: new e-mails in Thunderbird are no longer highlighted with a bold font. It has probably the same cause.

mhhh. Mozilla and MacOS a ever comlicated thematic..

It is present with Macbook Pro 16 2019 with Firefox 93 on MacOS Monterey 12.0.1
Problem with some Sites and Firefox Fonts itself.

This is a really serious issue. I still haven't seen it on any of my machines but I will attempt a fresh install today.

Assignee: nobody → mstange.moz
Status: NEW → ASSIGNED

I just upgraded to macOS Monterey and I got the issue. It's pretty terrible. I'm on Firefox Developer Edition 94.0b9 (64 bits), on an i5 Mac mini with an Intel UHD Graphics 630, on macOS 12.0.1 (21A559).

According to https://bugzilla.mozilla.org/show_bug.cgi?id=1715898#c5 this problem exists only on non English systems. I changed my System Primary Language to English and it works. Then I changed it back to my language this Problem occurs again.

[Tracking Requested - why for this release]: Serious quality regression on new version of macOS

Summary: Bad font rendering in macOS Monterey → Bad font rendering in macOS Monterey on non-English systems

I have set my system language to German and can reproduce the bug now.

Could this be also considered to be uplifted to ESR? Thunderbird is also affected and would suffer of this problem until next ESR.

Severity: S3 → S1
Priority: -- → P1

This is really bad on Thunderbird ESR. Not only has the font become incredibly small, but you can't tell unread emails from read ones apart. System language is German.

This has to do with font variation axis names, and CGFont and CTFont disagreeing about whether the axis names should be localized, it seems. We're not sure yet what exactly changed in macOS Monterey; it's possible that the system font didn't contain localized axis names in previous macOS versions.

Jonathan is working on a patch.

Assignee: mstange.moz → jfkthame

I checked the font with fonttools and it does not appear to contain the localized variation axes names.

The localization is happening here using the the default localized name:

  * frame #0: 0x00007ff8172670c8 CoreText`CopyDefaultLocalizedName(__CFString const*, __CFString const*, __CFArray const*, __CFString const**)
    frame #1: 0x00007ff8172c6b10 CoreText`CopyLocalizedFontNameInternal(CGFont*, CGFontNameTable*, int, __CFArray const*, __CFString const**, __CFString const*) + 1621
    frame #2: 0x00007ff8172c6d20 CoreText`CopyLocalizedFontName(CGFontNameTable*, int, __CFArray const*, __CFString const**, __CFString const*) + 34
    frame #3: 0x00007ff8173156ea CoreText`TBaseFont::CopyVariationAxesExternal() const + 356
    frame #4: 0x00007ff81725ed10 CoreText`CTFontCopyVariationAxes + 39

10.15 doesn't do the localization. I'm not sure about 11

The same for Cyrillic locale. The default font is too condensed (addressbar, search bar, Github, Wikipedia).
Found another confirmation here: https://www.reddit.com/r/firefox/comments/qfoxx1/macos_monterey_condensed_font_on_firefox_ui/

Attachment #9247883 - Attachment description: WIP: Bug 1732629 - WIP - Get axis names from CoreGraphics to avoid localization issue. → Bug 1732629 - [gfx/2d] Get non-localized variation axis names from CoreGraphics in ScaledFontMac, so that we set up the CGFont correctly with variation values. r=jrmuizel,mstange
See Also: → 1715898
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/59cc3481c534
[gfx/2d] Get non-localized variation axis names from CoreGraphics in ScaledFontMac, so that we set up the CGFont correctly with variation values. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/d67d7024d557
[gfx/wr] Fix new_ct_font_with_variations to use non-localized variation axis names from Core Graphics. r=jrmuizel

Comment on attachment 9247883 [details]
Bug 1732629 - [gfx/2d] Get non-localized variation axis names from CoreGraphics in ScaledFontMac, so that we set up the CGFont correctly with variation values. r=jrmuizel,mstange

Beta/Release Uplift Approval Request

  • User impact if declined: Bad rendering of the macOS system font (and potentially other variable fonts) for users on macOS 12 Monterey, when the system language is non-English
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Run macOS 12.0 Monterey; set the primary system language (in macOS System Preferences / Language & Region panel) to a non-English language; launch Firefox and observe the system font (in menus, tab titles, New Tab page, etc).
  • List of other uplifts needed: None
  • Risk to taking this patch: Medium
  • Why is the change risky/not risky? (and alternatives if risky): This feels a little risky because the macOS APIs involved are not well documented (e.g. the Apple docs don't tell us what axis names Core Graphics expects; nor do they guarantee that Core Graphics and Core Text will expose the axes in the same order, although that seems to hold true in practice).

OTOH, if any of the modified code fails, the result will be no worse than it was without the patches: failure to apply the proper variation settings to some fonts, leading to ugly text rendering.

  • String changes made/needed:
Attachment #9247883 - Flags: approval-mozilla-release?
Attachment #9247883 - Flags: approval-mozilla-esr91?
Attachment #9247883 - Flags: approval-mozilla-beta?
Attachment #9247975 - Flags: approval-mozilla-release?
Attachment #9247975 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/cc139b6131e4
[gfx/2d] Get non-localized variation axis names from CoreGraphics in ScaledFontMac, so that we set up the CGFont correctly with variation values. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/bf3b8e872279
[gfx/wr] Fix new_ct_font_with_variations to use non-localized variation axis names from Core Graphics. r=jrmuizel CLOSED TREE
Flags: needinfo?(jfkthame)
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/11e1be6ce402
followup, refresh Cargo.lock in wrench. a=wrench-fix CLOSED TREE

We can counteract a big part of the risk with extensive manual testing. We've encountered bugs in this area previously (bug 1201318, bug 1671660, bug 1672842, bug 1675185) so we have some idea of the things that could go wrong.

I think we should do the following checks, on the platforms: macOS 10.12 (Intel), macOS 10.13/10.14 (Intel), macOS 10.15 (Intel), macOS 11 (both Intel and M1), macOS 12 (both Intel and M1), and for both an English and a non-English system language:

I've made a spreadsheet to track testing progress: https://docs.google.com/spreadsheets/d/1aa1Biu72rX0bFYnCi3JOB0NzE-GECkP08Qx56bR1mSA/edit#gid=0

Edit: We've done testing on all these platforms now and the results look good.

Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/mozilla-central/rev/0ad5486182ff
[gfx/2d] Get non-localized variation axis names from CoreGraphics in ScaledFontMac, so that we set up the CGFont correctly with variation values. r=jrmuizel
https://hg.mozilla.org/mozilla-central/rev/b5086513fe50
[gfx/wr] Fix new_ct_font_with_variations to use non-localized variation axis names from Core Graphics. r=jrmuizel a=RyanVM
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
QA Whiteboard: [qa-triaged]

Comment on attachment 9247883 [details]
Bug 1732629 - [gfx/2d] Get non-localized variation axis names from CoreGraphics in ScaledFontMac, so that we set up the CGFont correctly with variation values. r=jrmuizel,mstange

Not seeing any new macOS crashes on Nightly since this landed. Thanks for all the work verifying this fix yesterday. Approved for 94.0rc2.

Attachment #9247883 - Flags: approval-mozilla-release?
Attachment #9247883 - Flags: approval-mozilla-release+
Attachment #9247883 - Flags: approval-mozilla-beta?
Attachment #9247975 - Flags: approval-mozilla-release?
Attachment #9247975 - Flags: approval-mozilla-release+
Attachment #9247975 - Flags: approval-mozilla-beta?

Comment on attachment 9247883 [details]
Bug 1732629 - [gfx/2d] Get non-localized variation axis names from CoreGraphics in ScaledFontMac, so that we set up the CGFont correctly with variation values. r=jrmuizel,mstange

Approved for 91.3esr.

Attachment #9247883 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+
Attachment #9247975 - Flags: approval-mozilla-esr91+
Blocks: 1737767

QA - Please expand exploratory testing around this issue/font-rendering in the UI.

(In reply to Audrey Fischer from comment #48)

QA - Please expand exploratory testing around this issue/font-rendering in the UI.

QA finished the smoke testing around this font rendering problem. Our testing revealed no issue. Details can be found inside this document.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

I can confirm, that the font now renders correctly again in Thunderbird 91 ESR on macOS 12.

Just to fill in a bit more background (thanks to Myles): the breakage here occurred because the Core Text API we're using (CTFontCopyVariationAxes) was fixed this year to return localized variation-axis names (as its documentation has always claimed); as Core Graphics only recognizes the non-localized ones, that led to the issue here.

Apparently there's a private interface CTFontCopyVariationAxesInternal that provides the non-localized names; webkit switched to this in https://trac.webkit.org/changeset/285318/webkit to avoid a performance regression in the case where they don't actually use the names. We could consider going that way as well, to avoid calling both CTFontCopyVariationAxes and CGFontCopyVariationAxes, although as it's not public API there's always the possibility it will break or disappear without notice in some future update.

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

Attachment

General

Creator:
Created:
Updated:
Size: