11
votes
Firefox refuses to use fonts in ~user/.config/fontconfig/fonts.conf
I have the following on my fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>system-ui</family>
<prefer>
<family>FreeSans</family>
</prefer>
</alias>
</fontconfig>
But when websites use font-family: system-ui
firefox just ignores this and uses Cantarell anyway, which I don't even know where it is getting it from. (Not Firefox font preferences).
Any idea how to make firefox respect my fonts.conf?
This is Linux with i3.
By chance is Firefox installed through Snap or Flatpak? I know that can sometimes cause issues like this.
Also, have you run
fc-cache
?No, I am using arch and installed using pacman.
Yeah I ran fc-cache and restarted firefox but no change.
Hmm, I took a look at my own fontconfig and noticed the DOCTYPE is slightly different:
I'm not all that familiar with fontconfig so I don't know if it matters, but maybe try changing that?
Tried it, still the same :| Thanks though
Just as a sanity check, do you have your desired font and its config under /etc/fonts/conf.d/ and symlinked correctly?
Yeah I can use the font in other apps..
Sorry for these basic checks but:
What are the results of:
fc-match system-ui
echo $XDG_CONFIG_HOME
fc-conflist
Does "+ /etc/fonts/conf.d/50-user.conf" appear in the output of
fc-conflist
?cat /etc/fonts/conf.d/50-user.conf
/etc/fonts/conf.d/
-sudo ln -s /usr/share/fontconfig/conf.default/50-user.conf /etc/fonts/conf.d/
After that although you said you used
fc-cache
did you use the flagsfc-cache -frv
?The output of fc-match is a bit strange but I think this is documented behavior:
/etc/fonts/conf.d/50-user.conf
is in the output offc-conflist
and loads my font.conf:$XDG_CONFIG_HOME
is set to$HOME/.config
I had used fc-cache -fv but just tried with -r and still get the same font... :|That seems to point at firefox. Either a bug (possible but unlikely) or a configuration clash somewhere which is my guess.
I once had a similar strange font replacement that I couldn't track down.
In the Fonts section of about:preferences I was told to check the default font setting, but also to click the Advanced... button. In the Fonts For dropdown to check the settings for both Latin (because my language is set to English), but also for Other Writing Systems.
In my case, those 2 settings were different and setting them all to be identical caused my problem to disappear.
The only other advice I can think of is to open about:config, search for font (there will be a lot of results) and see if Cantarell appears somewhere in those advanced settings.
Other than that I'm out of ideas and it may be worth filing a bug report. The experts will have far better troubleshooting skills than me.
tried that but didn't change. Thanks for your help anyway. I think I'll just try to get used to Cantarell :|
In the past I had issues with Firefox not displaying an installed font, and the solution was decreasing Firefox's sandbox level in about:support. It's been a while since I did this so I don't remember the details well enough to be better than just googling it, but that's what worked for me so it may be worth trying out.
I am using
privacy.resistFingerprinting
andlayout.css.font-visibility.resistFingerprinting
but I just disabled these and I still get the same font. Do you remember the setting you used?I also tried with a new fresh profile and I get the wrong font :|
I think it was
security.sandbox.content.level
-- it was definitely undersecurity.sandbox
and its value was an integer. Decreasing it (idr whether I needed 2 or 3 but I think the default was 4) and then restarting firefox then allowed certain installed fonts to be used for me.