Open Bug 1892620 Opened 1 year ago Updated 1 year ago

"font-family:Arial" uses Liberation Sans instaed of Arial, on Ubuntu with enhanced tracking protection set to strict

Categories

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

Firefox 124
defect

Tracking

()

UNCONFIRMED

People

(Reporter: 20h2, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0

Steps to reproduce:

OS: Ubuntu 23.10
Chrome renders Arial like Arial.
Firefox Portable version (.zip downloaded) renders Arial like Arial.
Firefox Official APT package renders Arial like Liberation Sans.
Open www.google.com, look at font of "Gmail"/"Images" on the top right corner of Google homepage.

Actual results:

Open bing.com or google.com, and found that for Mozilla-maintained APT version of Firefox, Arial is incorrectly rendered, something like Liberation Sans.

Firefox Portable version on Linux has no problem.
Please view the screenshot attached for details.

Expected results:

Render Arial as Arial rather than something like Liberation Sans.

LOTS OF websites use Arial by default in their CSS config, thus this problem impacts many websites.
But I wonder why portable Firefox on Ubuntu 23.10 does NOT have this problem.

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Text and Fonts' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Text and Fonts
Product: Firefox → Core

Just to disambiguate: when you say "Firefox Official APT package", are you referring to the official Ubuntu-provided default-installed Firefox package (which is a packaged via 'snap' these days)? (I'm asking because Mozilla also has its own separate "official" .deb and apt-repo, details on https://support.mozilla.org/en-US/kb/install-firefox-linux#w_install-firefox-deb-package-for-debian-based-distributions , but that requires some non-default system configuration so I suspect that's not what you're talking about).

Also, can you check Firefox's DevTools to see what font is actually being selected, in the "good" vs. "bad" cases? See bug 1850830 comment 2 for steps on how do do that (labeled (1) through (4) there). Note that Ubuntu doesn't actually ship with the Arial font, so unless you've manually installed it yourself, we have to find some similar font (and Firefox defers to the system fontconfig configuration to choose which font to use). And I have a guess at why you might be getting different results...

If you're seeing a difference between the Ubuntu-provided Firefox vs. another version like Portable Firefox, then I would guess that Ubuntu's snap packaging is the explanation, since that does add some application-isolation restrictions, which might be impacting font discoverability. You could test that by trying to run the Firefox binary extracted from the official Mozilla-provided .tar.bz2 archive, from e.g. https://www.mozilla.org/en-US/firefox/new/ . I'm guessing that version might not show the issue.

Flags: needinfo?(20h2)

(In reply to Daniel Holbert [:dholbert] from comment #2)

Just to disambiguate: when you say "Firefox Official APT package", are you referring to the official Ubuntu-provided default-installed Firefox package (which is a packaged via 'snap' these days)? (I'm asking because Mozilla also has its own separate "official" .deb and apt-repo, details on https://support.mozilla.org/en-US/kb/install-firefox-linux#w_install-firefox-deb-package-for-debian-based-distributions , but that requires some non-default system configuration so I suspect that's not what you're talking about).

Also, can you check Firefox's DevTools to see what font is actually being selected, in the "good" vs. "bad" cases? See bug 1850830 comment 2 for steps on how do do that (labeled (1) through (4) there). Note that Ubuntu doesn't actually ship with the Arial font, so unless you've manually installed it yourself, we have to find some similar font (and Firefox defers to the system fontconfig configuration to choose which font to use). And I have a guess at why you might be getting different results...

If you're seeing a difference between the Ubuntu-provided Firefox vs. another version like Portable Firefox, then I would guess that Ubuntu's snap packaging is the explanation, since that does add some application-isolation restrictions, which might be impacting font discoverability. You could test that by trying to run the Firefox binary extracted from the official Mozilla-provided .tar.bz2 archive, from e.g. https://www.mozilla.org/en-US/firefox/new/ . I'm guessing that version might not show the issue.

Ubuntu/Canonical does NOT provide APT package of Firefox.
What I use is from
https://support.mozilla.org/en-US/kb/install-firefox-linux?utm_source=www.mozilla.org&utm_medium=referral&utm_campaign=firefox-download-thanks#w_install-firefox-deb-package-for-debian-based-distributions

Mozilla maintained APT repository, irrelevant to Canonical.

Flags: needinfo?(20h2)

(In reply to 20h2 from comment #3)

(In reply to Daniel Holbert [:dholbert] from comment #2)

Just to disambiguate: when you say "Firefox Official APT package", are you referring to the official Ubuntu-provided default-installed Firefox package (which is a packaged via 'snap' these days)? (I'm asking because Mozilla also has its own separate "official" .deb and apt-repo, details on https://support.mozilla.org/en-US/kb/install-firefox-linux#w_install-firefox-deb-package-for-debian-based-distributions , but that requires some non-default system configuration so I suspect that's not what you're talking about).

Also, can you check Firefox's DevTools to see what font is actually being selected, in the "good" vs. "bad" cases? See bug 1850830 comment 2 for steps on how do do that (labeled (1) through (4) there). Note that Ubuntu doesn't actually ship with the Arial font, so unless you've manually installed it yourself, we have to find some similar font (and Firefox defers to the system fontconfig configuration to choose which font to use). And I have a guess at why you might be getting different results...

If you're seeing a difference between the Ubuntu-provided Firefox vs. another version like Portable Firefox, then I would guess that Ubuntu's snap packaging is the explanation, since that does add some application-isolation restrictions, which might be impacting font discoverability. You could test that by trying to run the Firefox binary extracted from the official Mozilla-provided .tar.bz2 archive, from e.g. https://www.mozilla.org/en-US/firefox/new/ . I'm guessing that version might not show the issue.

Ubuntu/Canonical does NOT provide APT package of Firefox.
What I use is from
https://support.mozilla.org/en-US/kb/install-firefox-linux?utm_source=www.mozilla.org&utm_medium=referral&utm_campaign=firefox-download-thanks#w_install-firefox-deb-package-for-debian-based-distributions

Mozilla maintained APT repository, irrelevant to Canonical.

Liberation Sans

I use fc-match -v 'Arial' and sudo fc-match -v 'Arial', and it seems that they all point to the correct Arial fonts. Chrome (APT from Google) does NOT have this issue. And I am sure I installed Arial by using ttf-mscorefonts-installer.

(In reply to 20h2 from comment #3)

Ubuntu/Canonical does NOT provide APT package of Firefox.

They sort-of do; canonical provides (and default-installs) a "transitional dummy package" of the name firefox, which just installs the snap, I think; that's what makes things confusing, and that's why I was clarifying.

Anyway: sounds like you've got the Mozilla-provided deb installed, though it's possible that Ubuntu is still automagically launching the snap for you.

Request: Could you double-check in the "bad" Firefox by viewing "Help | About", just to be extra sure that it's the build that you think it is? That should show "Mozilla Firefox Debian Package" / "mozilla-deb - 1.0" in one version vs. "Mozilla Firefox snap for Ubuntu" in the other. (I just want to be extra-sure we're considering the correct set of constraints etc. It's unfortunately a bit easy to mix up since the snap is installed by default and doesn't go away automatically when you install the deb.)

In any case, I just tested both the Mozilla-apt-provided .deb and the Ubuntu-provided snap, on a local Ubuntu 24.04beta system with ttf-mscorefonts-installer installed, and so far I can't reproduce -- font-family:Arial gets me actual Arial (as reported in DevTools) in both builds. So there may be other factors involved (e.g. it's conceivable there are differences between 23.10 and 24.04 that might come into play, perhaps)

(In reply to Daniel Holbert [:dholbert] from comment #7)

(In reply to 20h2 from comment #3)

Ubuntu/Canonical does NOT provide APT package of Firefox.

They sort-of do; canonical provides (and default-installs) a "transitional dummy package" of the name firefox, which just installs the snap, I think; that's what makes things confusing, and that's why I was clarifying.

Anyway: sounds like you've got the Mozilla-provided deb installed, though it's possible that Ubuntu is still automagically launching the snap for you.

Request: Could you double-check in the "bad" Firefox by viewing "Help | About", just to be extra sure that it's the build that you think it is? That should show "Mozilla Firefox Debian Package" / "mozilla-deb - 1.0" in one version vs. "Mozilla Firefox snap for Ubuntu" in the other. (I just want to be extra-sure we're considering the correct set of constraints etc. It's unfortunately a bit easy to mix up since the snap is installed by default and doesn't go away automatically when you install the deb.)

In any case, I just tested both the Mozilla-apt-provided .deb and the Ubuntu-provided snap, on a local Ubuntu 24.04beta system with ttf-mscorefonts-installer installed, and so far I can't reproduce -- font-family:Arial gets me actual Arial (as reported in DevTools) in both builds. So there may be other factors involved (e.g. it's conceivable there are differences between 23.10 and 24.04 that might come into play, perhaps)

Double checked, it is "mozilla-deb - 1.0". Uninstalling everything related to snap is my top priority in using Ubuntu, after I had found that snap-version of JetBrains IDE requires ~40 seconds to launch. I believe my Ubuntu 23.10 is snap free.

Just now, I tried to visit https://lilianweng.github.io/ and found the mozilla-deb Firefox renders the webpage in Ubuntu. (Downloaded portable version of Firefox is OK.)

The font list of Lil'Log is: -apple-system,BlinkMacSystemFont,segoe ui,Roboto,Oxygen,Ubuntu,Cantarell,open sans,helvetica neue,sans-serif

I cannot understand why it rolls back to Ubuntu font, when I found I have Roboto installed in /usr/share/fonts/truetype/roboto/unhinted/RobotoTTF

The odd thing is: by using ttf-mscorefonts-installer, Arial is installed as root user. And for mozilla-deb version of Firefox, its executable is in /usr/bin/firefox and the process name is firefox-bin.

But portable Firefox is OK (I need to correct that portable version is .tar.bz2 rather than .zip). Just confused why the difference happens.

Considering that Ubuntu 24.04 is just in 3 days, maybe I can wait for 3 days to double check this issue.

I wonder if this is related to anti-fingerprinting font visibility restrictions.

If you go into about:config and set privacy.fingerprintingProtection.overrides to the string -FontVisibilityLangPack (note the initial hyphen), does that affect the behavior? (I think you have to quit and relaunch the browser for that to take effect.)

Flags: needinfo?(20h2)

(In reply to Jonathan Kew [:jfkthame] from comment #9)

I wonder if this is related to anti-fingerprinting font visibility restrictions.

If you go into about:config and set privacy.fingerprintingProtection.overrides to the string -FontVisibilityLangPack (note the initial hyphen), does that affect the behavior? (I think you have to quit and relaunch the browser for that to take effect.)

Problem solved completely. Wonder why this would happen. I know I set Enhanced Tracking Protection to strict, and I know I may ecounter some quaint problems. But I never realize this cause font substituting.

It seems that no font substituting methdology is mentioned in
https://support.mozilla.org/en-US/kb/enhanced-tracking-protection-firefox-desktop?as=u&utm_source=inproduct

I would appreciate it if I can be provided with design docs on font substituting when enhanced tracking protection set to strict. Thanks.

Flags: needinfo?(20h2)

Bug 1827475 tracks issues related to restricting font visibility, so I'll cross-reference this report there for the team's consideration.

Blocks: 1827475
Summary: Firefox APT version renders Arial like Liberation Sans → "font-family:Arial" uses Liberation Sans instaed of Arial, on Ubuntu with enhanced tracking protection set to strict
Severity: -- → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: