How to fix Fontconfig error: failed reading config file

5,940

Solution 1

Have a look at /etc/fonts/conf.avail and /etc/fonts/conf.d . I came across this question because I had the same problem. Finally

FC_DEBUG=1024 fc-cache 2>&1|less did not tell anything helpful. So I ran the following command looking for missing configuration files.

FC_DEBUG=1024 strace fc-cache 2>&1|less

It turned out that the configuration file from the fonts-guru-extra package was messed up. It was stored as /etc/fonts/conf.avail/65-0-fonts-guru-extra.conf/65-0-fonts-guru-extra.conf and the symlink from /etc/fonts/conf.avail/65-0-fonts-guru-extra.conf was somehow broken. At least it was not a file.

So I ran dpkg --force-depends --purge fonts-guru-extra and dpkg complained about a non-empty directory /etc/fonts/conf.avail/65-0-fonts-guru-extra.conf I deleted this directory by hand and ran

apt-get install fonts-guru-extra

and afterwards the error message was gone.

Solution 2

This worked in my case (probably, it's a more universal solution):

# dpkg --force-depends --purge fontconfig-config
# aptitude install fontconfig-config
# dpkg-reconfigure fontconfig-config

For me the problem was caused by downgrading fontconfig from 2.13 to 2.11 on debian stretch.

Share:
5,940

Related videos on Youtube

iuvbio
Author by

iuvbio

python pasionista data es vida

Updated on September 18, 2022

Comments

  • iuvbio
    iuvbio 3 months

    On Debian testing, whenever I run a browser from the terminal, I get four lines of the following error:

    Fontconfig error: failed reading config file
    

    This doesn't seem to cause any problems in any application, only in Firefox Quantum installed via snap font rendering doesn't work correctly, just like here and here.

    I have already tried all the steps mentioned in the two posts, apart from installing the tar, since I'd like to keep the snap version. When I first installed the browser, I had rendering issues on more websites (like Stackoverflow), but installing Microsoft core fonts fixed this. Now, the issue seems to be with Helvetica only, however, fc-match Helvetica shows that Helvetica is correctly matched with Arial.

    So my conclusion is that somehow the "snap Firefox" is not able to read the fontconfig files (firefox-esr works fine, just like Opera and other browsers). I think the problem is not confined to Firefox Quantum though, because the error appears when I run another browser from command line as well. It just doesn't cause any issue there.

    So the question is really how to fix the fontconfig setup? I have already reinstalled and ran dpkg-reconfigure fontconfig-config.

    • Martin Bergström
      Martin Bergström over 4 years
      Seems a more informative error message is coming in a future fontconfig version.
  • Tobias Schlemmer
    Tobias Schlemmer about 4 years
    Actually there are two bug reports regarding this problem: bugs.debian.org/cgi-bin/bugreport.cgi?bug=854165 and bugs.debian.org/cgi-bin/bugreport.cgi?bug=866051