Why default view and print font on Firefox is forced to Liberation Serif?

In Firefox, when I want to view and print some Gmail messages sent from Windows users, the senders used Gmail Garamond font, on my Manjaro they appear with Liberation Serif font, and even the print is done with the same font while my browser font is set to Noto Serif/Sans. When I run fc-match Garamond or fc-match serif I get both NotoSerif-Regular.ttf: "Noto Serif" "Regular" How can I change at least the print font ?
I tested within Gmail by selecting Sans Serif and Serif fonts and after printing they both are replaced with Liberation Sans/Serif.

You can install ebgaramond-otf from the AUR.

It’s already installed, but the is no way to control printing process from browser and force it to replace Gmail “Garamond” or “Serif” fonts by EB Garamond or another font.

You need to set the font alias in fontconfig. The Arch Wiki provides excellent information on how to do this.

Two thoughts…

By selecting, do you mean in Gmail selecting Settings > General > Default text style?
Note: I’ve been reading the gmail help and it appears this is only for outgoing mail.

Toggle Firefox Settings > Fonts & Color > Advanced > Allow pages to choose their own fonts

This looks promising: Why doesn’t fc-match respect my match and edit rule for Courier when it does for Consolas?. In the accepted response, the user wanted to change the font when the " CSS font-family set to prefer Arial using Noto Sans".

man fonts-conf


1 Like

It’s the font selected when I edit a new message

The “Serif” and “Garamond” are displayed and printed as “Liberation Serif” while “Sans Serif” as “Liberation Sans”, even if my system is already configuered to replace them with “Noto Sans/Serif”.


I hope this isn’t the case :slight_smile: but there is a reference in the arch wiki:

Firefox has a setting which determines how many replacements it will allow from fontconfig. To allow it to use all your replacement-rules, change gfx.font_rendering.fontconfig.max_generic_substitutions to 127 (the highest possible value).

The default is 3.


Thanks, but unfortunately it didn’t help.

I don’t recall seeing what tool you are using to determine the font in FF, but so we are on the same page, I am using FF’s Web Developer Tools. The inspector has a button for “Font”.

Sure enough Liberation was being used. I was able to alter this with a userContent.css file and using @font-face. This could be restricted to the gmail domain.

I’m not versed in how FF selects a font-family, but it seems to be disconnected from the user’s system. If anyone knows, chime in please. Very interesting topic.

When I print my email to PDF or directly on paper I can see that only Liberation is embedded in PDF and on paper it’s easy to distinguish the difference because the ones printed on Windows look good and well formatted while the ones printed on Manjaro look bad (not appealing to eye) with Liberation font.