You are not logged in.
Hello, I'm having trouble getting fontconfig to apply my user configuration file located at ~/.config/fontconfig/fonts.conf.
My configuration file contains:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<description>Per user config</description>
<alias>
<family>monospace</family>
<default>
<family>Terminus</family>
</default>
</alias>
</fontconfig>And it is found by fontconfig, running fc-conflist outputs:
+ /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-hinting-slight.conf: Set hintslight to hintstyle
- /usr/share/fontconfig/conf.avail/10-no-sub-pixel.conf: Disable sub-pixel rendering
- /usr/share/fontconfig/conf.avail/10-scale-bitmap-fonts.conf: Bitmap scaling
- /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-default.conf: Use lcddefault as default for LCD filter
- /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/20-unhint-small-dejavu-lgc-sans-mono.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-dejavu-lgc-sans.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-dejavu-lgc-serif.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-dejavu-sans-mono.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-dejavu-sans.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-dejavu-serif.conf: No description
- /usr/share/fontconfig/conf.avail/20-unhint-small-vera.conf: Disable hinting for Bitstream Vera fonts when the size is less than 8ppem
- /usr/share/fontconfig/conf.avail/25-unhint-nonlatin.conf: Disable hinting for CJK fonts
- /usr/share/fontconfig/conf.avail/30-metric-aliases.conf: Set substitutions for similar/metric-compatible families
- /usr/share/fontconfig/conf.avail/35-lang-normalize.conf: No description
- /usr/share/fontconfig/conf.avail/40-nonlatin.conf: Set substitutions for non-Latin fonts
- /usr/share/fontconfig/conf.avail/45-generic.conf: Set substitutions for emoji/math fonts
- /usr/share/fontconfig/conf.avail/45-latin.conf: Set substitutions for Latin fonts
- /usr/share/fontconfig/conf.avail/49-sansserif.conf: Add sans-serif to the family when no generic name
- /home/user/.config/fontconfig/fonts.conf: Per user config
- /usr/share/fontconfig/conf.avail/50-user.conf: Load per-user customization files
- /usr/share/fontconfig/conf.avail/51-local.conf: Load local customization file
- /usr/share/fontconfig/conf.avail/57-dejavu-sans-mono.conf: No description
- /usr/share/fontconfig/conf.avail/57-dejavu-sans.conf: No description
- /usr/share/fontconfig/conf.avail/57-dejavu-serif.conf: No description
- /usr/share/fontconfig/conf.avail/58-dejavu-lgc-sans-mono.conf: No description
- /usr/share/fontconfig/conf.avail/58-dejavu-lgc-sans.conf: No description
- /usr/share/fontconfig/conf.avail/58-dejavu-lgc-serif.conf: No description
- /usr/share/fontconfig/conf.avail/60-generic.conf: Set preferable fonts for emoji/math fonts
- /usr/share/fontconfig/conf.avail/60-latin.conf: Set preferable fonts for Latin
- /usr/share/fontconfig/conf.avail/65-fonts-persian.conf: No description
- /usr/share/fontconfig/conf.avail/65-khmer.conf: No description
- /usr/share/fontconfig/conf.avail/65-nonlatin.conf: Set preferable fonts for non-Latin
- /usr/share/fontconfig/conf.avail/69-unifont.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-bookman.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-c059.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-d050000l.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-fallback-backwards.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-fallback-generics.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-fallback-specifics.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-gothic.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-nimbus-mono-ps.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-nimbus-roman.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-nimbus-sans.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-p052.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-standard-symbols-ps.conf: No description
- /usr/share/fontconfig/conf.avail/69-urw-z003.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
- /usr/share/fontconfig/conf.avail/75-yes-terminus.conf: No description
- /usr/share/fontconfig/conf.avail/80-delicious.conf: No description
- /usr/share/fontconfig/conf.avail/90-synthetic.conf: No descriptionHowever, running
fc-match monospaceoutputs:
DejaVuMathTeXGyre.ttf: "DejaVu Math TeX Gyre" "Regular"I thought this might be an issue with a global config file overriding mine, so I tried removing every global config except for 50-user.conf and the default one. fc-conflist now outputs:
+ /etc/fonts/fonts.conf: Default configuration file
- /home/user/.config/fontconfig/fonts.conf: Per user config
- /usr/share/fontconfig/conf.avail/50-user.conf: Load per-user customization filesBut, fc-match shows the same output as before. The two other config files, the default one and 50-user.conf are below.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
<description>Default configuration file</description>
<!--
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/local/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>
<!--
Accept alternate 'system ui' spelling, replacing it with 'system-ui'
-->
<match target="pattern">
<test qual="any" name="family">
<string>system ui</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>system-ui</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><?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<description>Load per-user customization files</description>
<!--
Load per-user customization files where stored on XDG Base Directory
specification compliant places. it should be usually:
$HOME/.config/fontconfig/conf.d
$HOME/.config/fontconfig/fonts.conf
-->
<include ignore_missing="yes" prefix="xdg">fontconfig/conf.d</include>
<include ignore_missing="yes" prefix="xdg">fontconfig/fonts.conf</include>
<!-- the following elements will be removed in the future -->
<include ignore_missing="yes" deprecated="yes">~/.fonts.conf.d</include>
<include ignore_missing="yes" deprecated="yes">~/.fonts.conf</include>
</fontconfig>Also, in the fc-conflist output, is there a meaning to the first symbol of each line, the +/-? On another system I have running Arch, the line with my user config file begins with a + instead of a -, and it works.
If there's any other useful information I could provide, please let me know.
Thanks in advance.
Last edited by aspiring_walrus (2021-05-16 07:49:16)
Offline
Instead of using <default/>, try with <prefer/>
And restore the system wide files
Offline
I tried using <prefer> with and without the system wide configs, but neither worked. I got the same output as before. My config looks like this now:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<description>Per user config</description>
<alias>
<family>monospace</family>
<prefer>
<family>Terminus</family>
</prefer>
</alias>
</fontconfig>Offline
What do you get from:
fc-match -s monospaceOffline
I get:
DejaVuMathTeXGyre.ttf: "DejaVu Math TeX Gyre" "Regular"
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
DejaVuSerif.ttf: "DejaVu Serif" "Book"
SourceCodePro-Regular.otf: "Source Code Pro" "Regular"
D050000L.otf: "D050000L" "Regular"
C059-Roman.otf: "C059" "Roman"
Cantarell-Regular.otf: "Cantarell" "Regular"
DejaVuSansMono-Bold.ttf: "DejaVu Sans Mono" "Bold"
DejaVuSerif-Bold.ttf: "DejaVu Serif" "Bold"
DejaVuSerif-Italic.ttf: "DejaVu Serif" "Italic"
DejaVuSans-Oblique.ttf: "DejaVu Sans" "Oblique"
DejaVuSans-BoldOblique.ttf: "DejaVu Sans" "Bold Oblique"
ter-u12n.otb: "Terminus" "Regular"
ter-x12n.pcf.gz: "xos4 Terminus" "Regular"Offline
Also, in the fc-conflist output, is there a meaning to the first symbol of each line, the +/-?
Yes, '+' indicates that the rule is enabled.
Recently, there were some changes as to how the config files are organized. I'm not sure if it is still the recommended way in the new organization but it works: To enable a rule, create a symlink in /etc/fonts/conf.d. You might also check for broken links in that directory.
Offline
Yes, '+' indicates that the rule is enabled.
I thought this might be the case, but I couldn't find any information on it. Looking at the symlinks in /etc/fonts/conf.d, they are all relative for some reason, I changed them to absolute paths and they work now. Thanks a bunch for your help, and have a good day.
Offline
+ /etc/fonts/fonts.conf: Default configuration file
- /home/user/.config/fontconfig/fonts.conf: Per user config
- /usr/share/fontconfig/conf.avail/50-user.conf: Load per-user customization filesThis is from what seems to be the initial fc-confilist, before any "i'll just delete this symlink" shenaningans?
50-user.conf isn't enabled and it's what's loads the user config files, resulting in /home/user/.config/fontconfig/fonts.conf ("user" smells as if you edited this? Please highlight any edit you make to any output and make extra sure that this is the ONLY edit you made, details matter) not being loaded either.
Edit: F5-F5-F5-F5-F5-F5-F5-F5…
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Last edited by seth (2021-05-16 07:05:49)
Offline
Yes, I edited the path /home/user/... sorry I forgot to mention it. Also, sorry I forgot to mark my post as solved. I'll keep those in mind if I make another post. Thanks again.
Offline