Everything in conf.avail is applied, even when using FONTCONFIG_FILE
I set FONTCONFIG_FILE to override the config, but the entire contents of the system /usr/share/fontconfig/conf.avail
are processed.
I've used this for many years to have my own font config without root access or modifying installed packages, and sometimes per-application settings.
Recently I noticed the system config affecting the font settings, but I don't know when this began.
There seems to be some kind of 'modal' behaviour here depending on whether FONTCONFIG_FILE is unset, set, or does not exist -- note the flipping between /usr/share/fontconfig
and /etc/fonts
in the logs below. I haven't traced the source code to see why. The two distros I tested both seem to have duplicates of the files.
This negates much of the conf.d
-> conf.avail
symlinking, if all the files are being read?
If FONTCONFIG_FILE
still reads the system config then I imagine this may interfere with the test cases in the source code?
The logs below are from Alpine Linux, but I tested fc-conflist
on:
- Alpine Linux 3.18 (fontconfig-2.14.2-r3)
- Slackware 15.0 (fontconfig-2.13.92-x86_64-3)
$ FONTCONFIG_FILE=$HOME/.fonts.conf fc-conflist
+ /home/mark/.fonts.conf: No description
- /usr/share/fontconfig/conf.avail/05-reset-dirs-sample.conf: Re-define fonts dirs sample
- /usr/share/fontconfig/conf.avail/09-autohint-if-no-hinting.conf: Enable autohinter if font doesn't have any hinting
- /usr/share/fontconfig/conf.avail/10-autohint.conf: Enable autohinter
- /usr/share/fontconfig/conf.avail/10-hinting-full.conf: Set hintfull to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-medium.conf: Set hintmedium to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-none.conf: Set hintnone to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-slight.conf: Set hintslight to hintstyle
- /usr/share/fontconfig/conf.avail/10-no-antialias.conf: Disable antialiasing
- /usr/share/fontconfig/conf.avail/10-scale-bitmap-fonts.conf: Bitmap scaling
[...]
- /usr/share/fontconfig/conf.avail/90-synthetic.conf: No description
$ FONTCONFIG_FILE=$HOME/does-not-exist fc-conflist
Fontconfig error: Cannot load default config file: No such file: (null)
+ /etc/fonts/conf.d/10-hinting-slight.conf: Set hintslight to hintstyle
+ /etc/fonts/conf.d/10-scale-bitmap-fonts.conf: Bitmap scaling
+ /etc/fonts/conf.d/10-sub-pixel-none.conf: Disable sub-pixel rendering
+ /etc/fonts/conf.d/10-yes-antialias.conf: Enable antialiasing
+ /etc/fonts/conf.d/11-lcdfilter-default.conf: Use lcddefault as default for LCD filter
+ /etc/fonts/conf.d/20-unhint-small-vera.conf: Disable hinting for Bitstream Vera fonts when the size is less than 8ppem
+ /etc/fonts/conf.d/30-liberation-mono.conf: No description
+ /etc/fonts/conf.d/30-liberation-sans-narrow.conf: No description
+ /etc/fonts/conf.d/30-liberation-sans.conf: No description
+ /etc/fonts/conf.d/30-liberation-serif.conf: No description
[...]
+ /etc/fonts/conf.d/90-tt-dejavu.conf: No description
+ memory: No description
$ export -n FONTCONFIG_FILE
$ fc-conflist
+ /etc/fonts/conf.d/10-hinting-slight.conf: Set hintslight to hintstyle
+ /etc/fonts/conf.d/10-scale-bitmap-fonts.conf: Bitmap scaling
+ /etc/fonts/conf.d/10-sub-pixel-none.conf: Disable sub-pixel rendering
+ /etc/fonts/conf.d/10-yes-antialias.conf: Enable antialiasing
+ /etc/fonts/conf.d/11-lcdfilter-default.conf: Use lcddefault as default for LCD filter
+ /etc/fonts/conf.d/20-unhint-small-vera.conf: Disable hinting for Bitstream Vera fonts when the size is less than 8ppem
+ /etc/fonts/conf.d/30-liberation-mono.conf: No description
+ /etc/fonts/conf.d/30-liberation-sans-narrow.conf: No description
+ /etc/fonts/conf.d/30-liberation-sans.conf: No description
+ /etc/fonts/conf.d/30-liberation-serif.conf: No description
+ /etc/fonts/conf.d/30-metric-aliases.conf: Set substitutions for similar/metric-compatible families
+ /etc/fonts/conf.d/40-nonlatin.conf: Set substitutions for non-Latin fonts
+ /etc/fonts/conf.d/42-luxi-mono.conf: No description
+ /etc/fonts/conf.d/45-dejavu.conf: No description
+ /etc/fonts/conf.d/45-generic.conf: Set substitutions for emoji/math fonts
+ /etc/fonts/conf.d/45-latin.conf: Set substitutions for Latin fonts
+ /etc/fonts/conf.d/45-liberation-sans-narrow.conf: No description
+ /etc/fonts/conf.d/45-liberation.conf: No description
+ /etc/fonts/conf.d/48-spacing.conf: Add mono to the family when spacing is 100
+ /etc/fonts/conf.d/49-sansserif.conf: Add sans-serif to the family when no generic name
+ /home/mark/.fonts.conf: No description
+ /etc/fonts/conf.d/50-user.conf: Load per-user customization files
+ /etc/fonts/conf.d/51-local.conf: Load local customization file
+ /etc/fonts/conf.d/60-generic.conf: Set preferable fonts for emoji/math fonts
+ /etc/fonts/conf.d/60-latin.conf: Set preferable fonts for Latin
+ /etc/fonts/conf.d/65-fonts-persian.conf: No description
+ /etc/fonts/conf.d/65-nonlatin.conf: Set preferable fonts for non-Latin
+ /etc/fonts/conf.d/69-unifont.conf: No description
+ /etc/fonts/conf.d/80-delicious.conf: No description
+ /etc/fonts/conf.d/90-liberation-sans-narrow.conf: No description
+ /etc/fonts/conf.d/90-liberation.conf: No description
+ /etc/fonts/conf.d/90-synthetic.conf: No description
+ /etc/fonts/conf.d/90-tt-dejavu.conf: No description
+ /etc/fonts/fonts.conf: Default configuration file
- /usr/share/fontconfig/conf.avail/05-reset-dirs-sample.conf: Re-define fonts dirs sample
- /usr/share/fontconfig/conf.avail/09-autohint-if-no-hinting.conf: Enable autohinter if font doesn't have any hinting
- /usr/share/fontconfig/conf.avail/10-autohint.conf: Enable autohinter
- /usr/share/fontconfig/conf.avail/10-hinting-full.conf: Set hintfull to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-medium.conf: Set hintmedium to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-none.conf: Set hintnone to hintstyle
- /usr/share/fontconfig/conf.avail/10-no-antialias.conf: Disable antialiasing
- /usr/share/fontconfig/conf.avail/10-sub-pixel-bgr.conf: Enable sub-pixel rendering with the BGR stripes layout
- /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf: Enable sub-pixel rendering with the RGB stripes layout
- /usr/share/fontconfig/conf.avail/10-sub-pixel-vbgr.conf: Enable sub-pixel rendering with the vertical BGR stripes layout
- /usr/share/fontconfig/conf.avail/10-sub-pixel-vrgb.conf: Enable sub-pixel rendering with the vertical RGB stripes layout
- /usr/share/fontconfig/conf.avail/10-unhinted.conf: Disable hinting
- /usr/share/fontconfig/conf.avail/11-lcdfilter-legacy.conf: Use lcdlegacy as default for LCD filter
- /usr/share/fontconfig/conf.avail/11-lcdfilter-light.conf: Use lcdlight as default for LCD filter
- /usr/share/fontconfig/conf.avail/25-unhint-nonlatin.conf: Disable hinting for CJK fonts
- /usr/share/fontconfig/conf.avail/35-lang-normalize.conf: No description
- /usr/share/fontconfig/conf.avail/65-khmer.conf: No description
- /usr/share/fontconfig/conf.avail/70-no-bitmaps.conf: Reject bitmap fonts
- /usr/share/fontconfig/conf.avail/70-yes-bitmaps.conf: Accept bitmap fonts