`system-ui` doesn't use Gnome settings, only fontconfig
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
People
(Reporter: julienw, Assigned: emilio)
References
Details
Attachments
(4 files)
Since the support of system-ui
, some websites changed their appearance, which is expected. But the right font doesn't seem to be selected on my system.
This is happening especially on Github: DejaVu Sans is used according to the devtools.
This is inconsistent with the rest of my system, because in my Gnome, Cantarell is configured instead.
BTW I double-checked in Chrome and I think they select Cantarell indeed (this is especially visible with the # sign).
Here is an real-life page: https://github.com/firefox-devtools/profiler/pulls
Reporter | ||
Comment 1•3 years ago
|
||
Another test page is https://bl.ocks.org/nolanlawson/b72a9e2b9be8710ef0668b7cb968afe3
(from https://nolanlawson.com/2020/05/02/customizing-fonts-in-firefox-on-linux/ which is 1 year old but discuss a similar problem from before we supported system-ui
, I believe).
Reporter | ||
Comment 2•3 years ago
|
||
Reporter | ||
Comment 3•3 years ago
|
||
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Comment 4•3 years ago
|
||
So if you do something like <span style="font: menu">
, does cantarell get used? If so I'm not sure what might be going on as we're supposed to just use that font family.
Assignee | ||
Comment 5•3 years ago
|
||
What distro are you using, so I can try to repro? On Fedora at least it seems to use the gnome-settings font.
I see this on Debian Testing, in GNOME Shell and Wayland.
data:text/html,<span style="font-family:system-ui">hello
...renders in Bitstream Vera Sans.
data:text/html,<span style="font:menu">hello
...renders in my UI font.
Reporter | ||
Comment 7•3 years ago
|
||
I use Debian stable (the new one: bullseye), recently installed. I didn't configure anything fancy about fonts (yet).
Here:
data:text/html,<span style="font-family:system-ui">hello
gives DejaVu Sans (the fontconfig default font).
data:text/html,<span style="font:menu">hello
gives Cantarell (the Gnome default font).
I'm not sure how Gnome configures the default font. It doesn't look like it does so using fontconfig's configuration files. So it might be a fontconfig / Debian / Gnome issue in the end (?). But it would be nice to understand the underlying issue, and possibly write documentation on support.mozilla.org if we decide it's not an issue on our end.
Comment 8•3 years ago
|
||
I am experiencing the same behavior with the latest Nightly, on my Ubuntu 21.04 running GNOME shell (wayland): font-family: system-ui
gives me DejaVu Sans, font: menu
gives me Ubuntu (the default font configured through GNOME).
Assignee | ||
Comment 9•3 years ago
|
||
Ok, I'll try to dig a bit into this on an Ubuntu or Debian VM.
Assignee | ||
Comment 10•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 11•3 years ago
|
||
Comment on attachment 9238663 [details]
Bug 1728086 - Fix system-ui support on Linux distros where Gnome settings aren't mapped to fontconfig. r=jfkthame
Beta/Release Uplift Approval Request
- User impact if declined: system-ui won't work properly in common distros like Debian and Ubuntu.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: comment 0
- List of other uplifts needed: none
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Very simple change to use the common code-path for the system-ui generic.
- String changes made/needed: none
Assignee | ||
Updated•3 years ago
|
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
Comment on attachment 9238663 [details]
Bug 1728086 - Fix system-ui support on Linux distros where Gnome settings aren't mapped to fontconfig. r=jfkthame
92 is on release now
Comment 14•3 years ago
|
||
Backed out for failures on system-ui-ar.html
-
backout: https://hg.mozilla.org/integration/autoland/rev/809bee6c71fe1c70cf15e97fe7e65a34bce62625
-
failure log: https://treeherder.mozilla.org/logviewer?job_id=350067485&repo=autoland&lineNumber=6385
[task 2021-08-31T14:23:51.031Z] 14:23:51 INFO - TEST-START | /css/css-fonts/system-ui-ar.html
[task 2021-08-31T14:23:51.032Z] 14:23:51 INFO - PID 8417 | 1630419831025 Marionette INFO Testing http://web-platform.test:8000/css/css-fonts/system-ui-ar.html != http://web-platform.test:8000/css/css-fonts/system-ui-ar-notref.html
[task 2021-08-31T14:23:51.215Z] 14:23:51 INFO - PID 8417 | 1630419831214 Marionette INFO No differences allowed
[task 2021-08-31T14:23:51.254Z] 14:23:51 INFO - TEST-UNEXPECTED-FAIL | /css/css-fonts/system-ui-ar.html | Testing http://web-platform.test:8000/css/css-fonts/system-ui-ar.html != http://web-platform.test:8000/css/css-fonts/system-ui-ar-notref.html
[task 2021-08-31T14:23:51.254Z] 14:23:51 INFO - mismatch reftest has no differences
Assignee | ||
Comment 15•3 years ago
|
||
So I couldn't repro these failures even on a clean Ubuntu 18.04 install, which is what automation supposedly uses. Applying something like this fixes the tests as expected (because we add both the menu family and the fontconfig families to the family list).
Jonathan, does a fixup like that seem reasonable to you? I think the machines on automation just don't have the relevant UI fonts installed...
Comment 16•3 years ago
|
||
Yeah, that looks like it would be OK for now; r=me to update your patch & reland.
(Really, I think we handle system font names at the wrong level altogether, but that's a bigger issue for another bug and another day.)
Comment 17•3 years ago
|
||
Comment 18•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Comment 19•3 years ago
|
||
I have managed to reproduce this issue on Ubuntu 20 (with gnome) in Nightly v93.0a1 from 2021-08-30 and verify the fix in Nightly v93.0a1 2021-08-31 as different fonts are being displayed.
It does not occur in Beta v92.0(RC) so I'm not sure whether an uplift is necessary.
Comment 20•3 years ago
|
||
Leaving the qe-verify+ tag until it's certain whether an uplift should be verified.
Updated•3 years ago
|
Comment 22•3 years ago
|
||
Comment on attachment 9238663 [details]
Bug 1728086 - Fix system-ui support on Linux distros where Gnome settings aren't mapped to fontconfig. r=jfkthame
Approved for 92.0rc2.
Reporter | ||
Comment 23•3 years ago
|
||
I can confirm this is fixed in Nightly, and that I can see the problem in latest beta v92.
Comment 24•3 years ago
|
||
bugherder uplift |
Comment 25•3 years ago
|
||
I can't seem to reproduce the issue in the Beta channel on the same system with newly downloaded firefox instances of v92.0b8, v92.0b9, v92.0(build1) and neither on v92.0(build2). As I can not reproduce it reliably in Beta channel (weirdly not the case for Nightly channel), I can not verify the uplift.
Julien, could you please verify this uplift considering you're reproduced it?
Any idea why my system will only reproduce it in Nightly?
Reporter | ||
Comment 26•3 years ago
|
||
beta v92 20210830174627: KO
beta v92 20210901142158: verified fixed
I don't know why it wouldn't reproduce for you in beta if this reproduces in Nightly :/
Reporter | ||
Comment 27•3 years ago
|
||
For anyone coming here wondering how to change the font on Linux, gnome has a tool called "gnome-tweaks" where you can change the default fonts. In firefox you'll need to open a new tab for changes to apply.
Comment 28•3 years ago
|
||
Setting as verified based on the comments above.
I will check whether my system has any fonts applied.
Thank you for verification in FF92, Julien!
Comment 29•3 years ago
|
||
(In reply to Natalia Csoregi [:nataliaCs] from comment #14)
Backed out for failures on system-ui-ar.html
backout: https://hg.mozilla.org/integration/autoland/rev/809bee6c71fe1c70cf15e97fe7e65a34bce62625
failure log: https://treeherder.mozilla.org/logviewer?job_id=350067485&repo=autoland&lineNumber=6385
[task 2021-08-31T14:23:51.031Z] 14:23:51 INFO - TEST-START | /css/css-fonts/system-ui-ar.html [task 2021-08-31T14:23:51.032Z] 14:23:51 INFO - PID 8417 | 1630419831025 Marionette INFO Testing http://web-platform.test:8000/css/css-fonts/system-ui-ar.html != http://web-platform.test:8000/css/css-fonts/system-ui-ar-notref.html [task 2021-08-31T14:23:51.215Z] 14:23:51 INFO - PID 8417 | 1630419831214 Marionette INFO No differences allowed [task 2021-08-31T14:23:51.254Z] 14:23:51 INFO - TEST-UNEXPECTED-FAIL | /css/css-fonts/system-ui-ar.html | Testing http://web-platform.test:8000/css/css-fonts/system-ui-ar.html != http://web-platform.test:8000/css/css-fonts/system-ui-ar-notref.html [task 2021-08-31T14:23:51.254Z] 14:23:51 INFO - mismatch reftest has no differences
== Change summary for alert #31102 (as of Thu, 02 Sep 2021 01:07:11 GMT) ==
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|
7% | amazon FirstVisualChange | macosx1014-64-shippable-qr | cold webrender | 1,169.23 -> 1,083.33 |
7% | amazon dcf | macosx1014-64-shippable-qr | cold webrender | 991.93 -> 921.54 |
7% | amazon fcp | macosx1014-64-shippable-qr | cold webrender | 1,012.57 -> 941.33 |
7% | amazon fnbpaint | macosx1014-64-shippable-qr | cold webrender | 1,024.04 -> 952.17 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=31102
Description
•