X
Tap here to go to the mobile version of the site.

Support Forum

Incorrect fallback fonts on Linux

Posted

I have explained the issue on stack exchange, please take a look at this link: https://unix.stackexchange.com/questions/557237/firefox-fallback-font

It is a clean install, no userChrome etc., all settings are default

I have explained the issue on stack exchange, please take a look at this link: https://unix.stackexchange.com/questions/557237/firefox-fallback-font It is a clean install, no userChrome etc., all settings are default
Quote

Additional System Details

Installed Plug-ins

ublock origin, https everywhere

Application

  • User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.74 Safari/537.36

More Information

cor-el
  • Top 10 Contributor
  • Moderator
17670 solutions 159844 answers

Did you check in the Font Inspector what font(s) Firefox is using for each case?

For me Helvetica uses NimbusSanL-Regu (Nimbus Sans L) and the Arial cases use Liberation Sans, so it appears the for Arial no fallback to sans-serif is used. The last Sans-serif case uses the default font as set in Options/Preferences (DejaVu Sans) as expected. You didn't include a Serif case, so I'm not seeing the default Serif font being used. With zooming there is not much difference.

data:text/html;charset=utf-8;base64,PGJvZHk+CiAgICA8cCBzdHlsZT0iZm9udC1mYW1pbHk6IEFyaWFsIj5oZWxsby B3b3JsZCAoQXJpYWwpPC9wPgogICAgPHAgc3R5bGU9ImZvbnQtZmFtaWx5OiBIZWx2ZXRpY2EiPmhlbGxvIHdvcmxkIChIZWx2 ZXRpY2EpPC9wPgogICAgPHAgc3R5bGU9ImZvbnQtZmFtaWx5OiBBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmIj5oZWxsby B3b3JsZCAoQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZik8L3A+CiAgICA8cCBzdHlsZT0iZm9udC1mYW1pbHk6IHNhbnMt c2VyaWYiPmhlbGxvIHdvcmxkIChzYW5zLXNlcmlmKTwvcD4KICAgIDxwIHN0eWxlPSJmb250LWZhbWlseTogc2VyaWYiPmhlbG xvIHdvcmxkIChzZXJpZik8L3A+CjwvYm9keT4=

Did you check in the Font Inspector what font(s) Firefox is using for each case? For me Helvetica uses NimbusSanL-Regu (Nimbus Sans L) and the Arial cases use Liberation Sans, so it appears the for Arial no fallback to sans-serif is used. The last Sans-serif case uses the default font as set in Options/Preferences (DejaVu Sans) as expected. You didn't include a Serif case, so I'm not seeing the default Serif font being used. With zooming there is not much difference. data:text/html;charset=utf-8;base64,PGJvZHk+CiAgICA8cCBzdHlsZT0iZm9udC1mYW1pbHk6IEFyaWFsIj5oZWxsby B3b3JsZCAoQXJpYWwpPC9wPgogICAgPHAgc3R5bGU9ImZvbnQtZmFtaWx5OiBIZWx2ZXRpY2EiPmhlbGxvIHdvcmxkIChIZWx2 ZXRpY2EpPC9wPgogICAgPHAgc3R5bGU9ImZvbnQtZmFtaWx5OiBBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmIj5oZWxsby B3b3JsZCAoQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZik8L3A+CiAgICA8cCBzdHlsZT0iZm9udC1mYW1pbHk6IHNhbnMt c2VyaWYiPmhlbGxvIHdvcmxkIChzYW5zLXNlcmlmKTwvcD4KICAgIDxwIHN0eWxlPSJmb250LWZhbWlseTogc2VyaWYiPmhlbG xvIHdvcmxkIChzZXJpZik8L3A+CjwvYm9keT4=

Modified by cor-el

Was this helpful to you?
Quote

Question owner

Checked the font inspector, the five paragraphs you sent render to Bookerly, NimbusSansRegular, NimbusSansRegular, Ubuntu, Bookerly respectively.

What I don't understand is the following (for the different example lines): 1) Arial - a sans-serif font - instead of falling back to the sans-serif default (that would be Ubuntu) it falls back to the serif default (in this case Bookerly). 2) Helvetica - another sans-serif - falls back to NimbusSansRegular instead of the default sans-serif Ubuntu. I could understand this, if Arial would also resolve to NimbusSansRegular (because they both match Nimbus via fontconfig), but as you can see they are displayed differently. 3) Since Arial and Helvetica are non existent on the machine, it should revert to the third option (sans-serif). But it still uses NimbusSansRegular for some reason. I don't see the logic behind this choice. 4) and 5) are displayed as expected

The goal is that if Firefox cannot find the font (Arial, Helvetica etc) it falls back to the correct serif, sans-serif one defined by fontconfig.

Checked the font inspector, the five paragraphs you sent render to Bookerly, NimbusSansRegular, NimbusSansRegular, Ubuntu, Bookerly respectively. What I don't understand is the following (for the different example lines): 1) Arial - a sans-serif font - instead of falling back to the sans-serif default (that would be Ubuntu) it falls back to the serif default (in this case Bookerly). 2) Helvetica - another sans-serif - falls back to NimbusSansRegular instead of the default sans-serif Ubuntu. I could understand this, if Arial would also resolve to NimbusSansRegular (because they both match Nimbus via fontconfig), but as you can see they are displayed differently. 3) Since Arial and Helvetica are non existent on the machine, it should revert to the third option (sans-serif). But it still uses NimbusSansRegular for some reason. I don't see the logic behind this choice. 4) and 5) are displayed as expected The goal is that if Firefox cannot find the font (Arial, Helvetica etc) it falls back to the correct serif, sans-serif one defined by fontconfig.
Was this helpful to you?
Quote
cor-el
  • Top 10 Contributor
  • Moderator
17670 solutions 159844 answers

I get this and that matches what I posted above.

fc-match Arial => "Liberation Sans" "Regular"
fc-match Helvetica => "Nimbus Sans L" "Regular"
fc-match sans-serif => "DejaVu Sans" "Book"
fc-match serif => "Liberation Serif" "Regular"
I get this and that matches what I posted above. fc-match Arial => "Liberation Sans" "Regular" fc-match Helvetica => "Nimbus Sans L" "Regular" fc-match sans-serif => "DejaVu Sans" "Book" fc-match serif => "Liberation Serif" "Regular"
Was this helpful to you?
Quote

Question owner

Do you think this is a bug, or a correct default behavior? In the latter case is there any workaround?

Do you think this is a bug, or a correct default behavior? In the latter case is there any workaround?
Was this helpful to you?
Quote
Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.