1

I am tweaking some font settings in Arch Linux. I have created a new .conf file in /etc/fonts/conf.avail/ and symlinked it into /etc/fonts/conf.d. I would now like to test the changes. I have tried running fc-cache -rv and restarting the terminal. As far as I can tell my updates are not being applied.

The Arch Linux wiki states:

Fontconfig gathers all its configurations in a central file (/etc/fonts/fonts.conf). This file is replaced during fontconfig updates and should not be edited. Fontconfig-aware applications source this file to know available fonts and how they get rendered. This file is a conglomeration of rules from the global configuration (/etc/fonts/local.conf), the configured presets in /etc/fonts/conf.d/, and the user configuration file ($XDG_CONFIG_HOME/fontconfig/fonts.conf). fc-cache can be used to rebuild fontconfig's configuration, although changes will only be visible in newly launched applications.

However, my fonts.conf doesn't look like a conglomeration.

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>

<!--
    DO NOT EDIT THIS FILE.
    IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
    LOCAL CHANGES BELONG IN 'local.conf'.

    The intent of this standard configuration file is to be adequate for
    most environments.  If you have a reasonably normal environment and
    have found problems with this configuration, they are probably
    things that others will also want fixed.  Please submit any
    problems to the fontconfig bugzilla system located at fontconfig.org

    Note that the normal 'make install' procedure for fontconfig is to
    replace any existing fonts.conf file with the new version.  Place
    any local customizations in local.conf which this file references.

    Keith Packard
-->

<!-- Font directory list -->

    <dir>/usr/share/fonts</dir>
    <dir>/usr/share/fonts</dir>
    <dir prefix="xdg">fonts</dir>
    <!-- the following element will be removed in the future -->
    <dir>~/.fonts</dir>

<!--
  Accept deprecated 'mono' alias, replacing it with 'monospace'
-->
    <match target="pattern">
        <test qual="any" name="family">
            <string>mono</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>monospace</string>
        </edit>
    </match>

<!--
  Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
-->
    <match target="pattern">
        <test qual="any" name="family">
            <string>sans serif</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>sans-serif</string>
        </edit>
    </match>

<!--
  Accept deprecated 'sans' alias, replacing it with 'sans-serif'
-->
    <match target="pattern">
        <test qual="any" name="family">
            <string>sans</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>sans-serif</string>
        </edit>
    </match>

<!--
  Load local system customization file
-->
    <include ignore_missing="yes">conf.d</include>

<!-- Font cache directory list -->

    <cachedir>/var/cache/fontconfig</cachedir>
    <cachedir prefix="xdg">fontconfig</cachedir>
    <!-- the following element will be removed in the future -->
    <cachedir>~/.fontconfig</cachedir>

    <config>
<!--
  Rescan configuration every 30 seconds when FcFontSetList is called
 -->
        <rescan>
            <int>30</int>
        </rescan>
    </config>

</fontconfig>

I was hoping that it would allow me to see what the final combined set of font settings was.

migrated from superuser.com Jun 21 '17 at 10:20

This question came from our site for computer enthusiasts and power users.

  • I realized that I should have posted this to the Unix/Linux SE. If a mod could move me, I'd appreciate it. – Matthew Piziak Jun 21 '17 at 1:39
4

I have tried running fc-cache -rv and restarting the terminal. As far as I can tell my updates are not being applied.

Restarting an application should be enough to reload changes. A few applications even reload the config regularly without requiring a restart.

fc-cache is generally useless for config changes, as far as I know.

If your changes don't seem to be applied, it's probably because nothing matched, or if it did, the rules are not strong enough to apply.

I suggest adding something like this to have an unconditional, strongly bound, very visible change:

<match target="pattern">
    <edit name="family" mode="prepend" binding="strong">
        <string>Comic Sans MS</string>
    </edit>
</match>

You can tell it worked when your eyes start bleeding.

Note that even with this, rules that are evaluated after this one might modify this pattern further.

I've also used rejectfont blocks, which seem to have higher priority than anything else, but deal with specific TTF files, so you need to know what's being matched (FC_DEBUG=1 is enough)

<selectfont>
    <rejectfont>
        <glob>/usr/share/fonts/TTF/DejaVuSans.ttf</glob>
    </rejectfont>
</selectfont>

The other part of the question:

However, my fonts.conf doesn't look like a conglomeration.

The magic is in the <include ignore_missing="yes">conf.d</include> which includes everything else.

This is what it looks like in my system:

$ FC_DEBUG=1024 leafpad
    Loading config file /etc/fonts/fonts.conf
    Scanning config dir /etc/fonts/conf.d
    Loading config file /etc/fonts/conf.d/10-hinting-slight.conf
    Loading config file /etc/fonts/conf.d/10-scale-bitmap-fonts.conf
    Loading config file /etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf
    Loading config file /etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf
    Loading config file /etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf
    Loading config file /etc/fonts/conf.d/20-unhint-small-vera.conf
    Loading config file /etc/fonts/conf.d/30-metric-aliases.conf
    Loading config file /etc/fonts/conf.d/30-urw-aliases.conf
    Loading config file /etc/fonts/conf.d/30-win32-aliases.conf
    Loading config file /etc/fonts/conf.d/40-nonlatin.conf
    Loading config file /etc/fonts/conf.d/45-latin.conf
    Loading config file /etc/fonts/conf.d/49-sansserif.conf
    Loading config file /etc/fonts/conf.d/50-user.conf
    Scanning config dir /home/dx/.config/fontconfig/conf.d
    Loading config file /home/dx/.config/fontconfig/conf.d/10-powerline-symbols.conf
    Loading config file /home/dx/.config/fontconfig/fonts.conf
    Loading config file /home/dx/.fonts.conf
    Loading config file /etc/fonts/conf.d/51-local.conf
    Loading config file /etc/fonts/local.conf
    Loading config file /etc/fonts/conf.d/57-dejavu-sans-mono.conf
    Loading config file /etc/fonts/conf.d/57-dejavu-sans.conf
    Loading config file /etc/fonts/conf.d/57-dejavu-serif.conf
    Loading config file /etc/fonts/conf.d/60-latin.conf
    Loading config file /etc/fonts/conf.d/65-fonts-persian.conf
    Loading config file /etc/fonts/conf.d/65-nonlatin.conf
    Loading config file /etc/fonts/conf.d/69-unifont.conf
    Loading config file /etc/fonts/conf.d/75-fix-calibri.conf
    Loading config file /etc/fonts/conf.d/80-delicious.conf
    Loading config file /etc/fonts/conf.d/90-synthetic.conf
  • How did you list applied config files ? – EdiD Jul 9 '17 at 15:31
  • 1
    Ran "FC_DEBUG=1024 leafpad" where leafpad is just any random application that uses fontconfig. – dequis Jul 11 '17 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.