Skip to content

Bug 41116: Normalize system fonts.

With this patch all system fonts are displayed as sans-serif on Linux and Windows, and as -apple-system on macOS.

We should uplift this. So, my plan is to use this as a temporary patch, then go through Mozilla's review, then drop ours and cherry-pick Firefox's patch/ask for it to be uplifted to 102 ESR.

Also, I propose we add our default sans-serif, serif and monospace in fonts.conf on Linux, because from what I understand, this part of code is called by the CSS engine and seems to be pretty unrelated from the font system.

(I say so because another idea would be querying the font system to get the default font).

Also, I have added the patch there, rather than to the function that method calls to avoid repeating the code for each widget.

sans-serif on macOS instead of -apple-system works, but breaks system-ui (it is displayed in Times, see my screenshots on the issue). So, this choice improves UX on macOS and avoids us to go through obscure font magic. But I can deepen why system-ui becomes broken with sans-serif anyway, if needed.

On the other platforms, system-ui is the family of font: menu on Firefox, so, this patch solves also the original issue, without the need of disabling system-ui.

Fixes #41116 (closed).

Merge request reports