A mystery uncovered by Fedora 32 changing my default font

October 21, 2020

I upgraded my home machine to Fedora 32 earlier this week. Everything went smoothly, except that afterward various web pages looked just a little bit different in my Firefox. After poking around and finding a handy Firefox font related thing, I discovered that Fedora 32 had changed what the standard system 'serif', 'sans-serif' and 'monospace' font names mapped to from DejaVu (in Fedora 31) to Bitstream Vera (in Fedora 32). The two fonts are very close (DejaVu is a modification of Bitstream Vera), but apparently just far enough apart that I can tell the difference.

In theory this could all be controlled through Fontconfig. In practice my simple brute force fix was to remove the Bitstream Vera fonts on the grounds that I didn't need them and they aren't there on a standard Fedora 32 install. But afterward I started poking around the Fontconfig files in /etc/fonts/conf.d to see if I could spot why the change happened, and wound up more confused than before.

My office workstation is still on Fedora 31 and it is definitely using the DejaVu fonts (you can tell with 'fc-match serif' and so on). However, it has Bitstream Vera fonts installed, and both my Fedora 31 and 32 machines have an /etc/fonts/conf.d/60-latin.conf file that appears to specify that the Bitstream Vera fonts should be preferred over the DejaVu versions:

<description>Set preferable fonts for Latin</description>
  <alias>
    <family>serif</family>
      <prefer>
        <family>Bitstream Vera Serif</family>
        <family>DejaVu Serif</family>
        <family>Times New Roman</family>
        <family>Thorndale AMT</family>
[...]

Setting the magic $FC_DEBUG environment variable on my Fedora 31 machine (documented in fonts.conf) did not provide any enlightenment; it may provide debugging, but it doesn't make fc-match explain its decisions. Fedora 31 and 32 have essentially the same version of Fontconfig (2.13.92-3.fc31 and 2.13.92-9.fc32 respectively), so that isn't a smoking gun either.

So, as has happened before, I started with a surprising change and have wound up with a mystery of why my Fedora 31 machines worked (and work) the way they did. As far as I can tell, the system fonts should have mapped to Bitstream Vera even on Fedora 31.

(I'm also left with the puzzle about why Fedora even seems to prefer Bitstream Vera over DejaVu, given that DejaVu was created to improve on Bitstream Vera and long ago Fedora switched to them. Bitstream Vera isn't even installed on normal from-scratch Fedora installs and hasn't been for some time, which may be part of why this bit of configuration has lingered on.)


Comments on this page:

By Paul Bolle at 2020-10-21 12:35:57:

This entry made me look at my laptop running Fedora. I remembered having fiddled with fontconfig a few years ago.

It turned out I had a ~/.config/fontconfig/conf.d/60-latin.conf file that, I think, overrides the one in /etc/fonts. Its timestamp suggests I created it while running Fedora 26. So that could be the not-brute force way to achieve what you want.

(It's amazing what one can forget in a few years. I could have spent hours a few years ago to discover this. Or five minutes looking at some manpages and then on with my life. Either way, most of it is now in my memory hole...)

Hmm, this one is quite interesting. I'm using Fedora 32 and on my system, font "serif" maps to DejaVuSerif, and this system is only month or two old, without any additional changes done to the font configuration options after the install.

[ivan@main ~]$ fc-match serif
DejaVuSerif.ttf: "DejaVu Serif" "Regular"
[ivan@main ~]$ cat /etc/redhat-release 
Fedora release 32 (Thirty Two)
[ivan@main ~]$ rpm -q fontconfig
fontconfig-2.13.92-9.fc32.x86_64

I'm interested to see what would cause behavior you've explained during the upgrade process. Perhaps some lingering configuration in some other place (~/.config, ~/.local...)?

By cks at 2020-10-21 14:23:19:

A stock Fedora 32 system probably doesn't have any Bitstream Vera fonts installed; they're not installed by default if you set up a stock Fedora 32 system. If you actively install the Bitstream Vera fonts I think you'll find that things switch over. If you do have the Bitstream Vera fonts installed, that's very interesting.

(The simple way to do it is to install the bitstream-vera-fonts-all package through dnf, which will pull in all of the fonts.)

Written on 21 October 2020.
« Firefox has a little handy font-related thing on Unix (or at least Linux)
Keeping VMware Workstation VMs running when I quit from VMware »

Page tools: View Source, View Normal.
Search:
Login: Password:

Last modified: Wed Oct 21 00:50:50 2020
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.