Bug#1056783: fontconfig does not respect user configuration
PR
pedrib at gmail.com
Sun Nov 26 08:15:50 GMT 2023
Package: fontconfig
Version: 2.14.2-6
Severity: important
X-Debbugs-Cc: pedrib at gmail.com
As described in the fontconfig manual, the files at:
$HOME/.config/fontconfig/fonts.conf
/etc/fonts/local.conf
Should be able to override the system settings when it comes to choosing fonts
if the 50-user.conf and 51-local.conf configuration files are enabled.
Since the latest update, this is not true any more in Debian. In my
$HOME/.config/fontconfig/fonts.conf I have the following (which I have also
copied to /etc/fonts/local.conf):
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<description>Set preferable fonts for Latin</description>
<alias>
<family>serif</family>
<prefer>
<family>DejaVu Serif</family>
<family>Times New Roman</family>
<family>Thorndale AMT</family>
<family>Luxi Serif</family>
<family>Nimbus Roman No9 L</family>
<family>Nimbus Roman</family>
<family>Times</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>DejaVu Sans</family>
<family>Verdana</family>
<family>Arial</family>
<family>Albany AMT</family>
<family>Luxi Sans</family>
<family>Nimbus Sans L</family>
<family>Nimbus Sans</family>
<family>Helvetica</family>
<family>Lucida Sans Unicode</family>
<family>BPG Glaho International</family> <!--
lat,cyr,arab,geor -->
<family>Tahoma</family> <!--
lat,cyr,greek,heb,arab,thai -->
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
<family>Inconsolata</family>
<family>Andale Mono</family>
<family>Courier New</family>
<family>Cumberland AMT</family>
<family>Luxi Mono</family>
<family>Nimbus Mono L</family>
<family>Nimbus Mono</family>
<family>Nimbus Mono PS</family>
<family>Courier</family>
</prefer>
</alias>
<dir>~/.fonts</dir>
</fontconfig>
It's basically a copy of the /usr/share/fontconfig/conf.avail/60-latin.conf
with the Noto fonts removed since I hate those fonts :D
The configuration that loads the user and local configuration files are
enabled:
lrwxrwxrwx 1 root root 45 Nov 26 14:09 /etc/fonts/conf.d/50-user.conf ->
/usr/share/fontconfig/conf.avail/50-user.conf
lrwxrwxrwx 1 root root 46 Sep 15 05:05 /etc/fonts/conf.d/51-local.conf ->
/usr/share/fontconfig/conf.avail/51-local.conf
However, the system totally ignores my settings in the $HOME folder and in
/etc/fonts/local.conf and proceeds to select the Noto fonts as described in
60-latin.conf.
To test this, one needs to start a target program with the FC_DEBUG=4 variable,
such as:
FC_DEBUG=4 pcmanfm
This is extremely verbose so I won't paste here, but fontconfig seems to
process the /etc/fonts/conf.d files in order, starting from 00. Eventually it
gets to 50-user.conf and proceeds to load the file from
$HOME/.config/fontconfig/fonts.conf, and prepend my choices of DejaVu to the
font choice correctly:
Add Rule(kind:0, name: /home/john/.config/fontconfig/fonts.conf) [test]
pattern any family Equal(ignore blanks) "serif"
[edit]
Edit family Prepend "DejaVu Serif" Comma "Times New Roman" Comma
"Thorndale AMT" Comma "Luxi Serif" Comma "Nimbus Roman No9 L" Comma "Nimbus
Roman" Comma "Times";
Add Rule(kind:0, name: /home/john/.config/fontconfig/fonts.conf) [test]
pattern any family Equal(ignore blanks) "sans-serif"
[edit]
Edit family Prepend "DejaVu Sans" Comma "Verdana" Comma "Arial" Comma
"Albany AMT" Comma "Luxi Sans" Comma "Nimbus Sans L" Comma "Nimbus Sans" Comma
"Helvetica" Comma "Lucida Sans Unicode" Comma "BPG Glaho International" Comma
"Tahoma";
Add Rule(kind:0, name: /home/john/.config/fontconfig/fonts.conf) [test]
pattern any family Equal(ignore blanks) "monospace"
[edit]
Edit family Prepend "DejaVu Sans Mono" Comma "Inconsolata" Comma
"Andale Mono" Comma "Courier New" Comma "Cumberland AMT" Comma "Luxi Mono"
Comma "Nimbus Mono L" Comma "Nimbus Mono" Comma "Nimbus Mono PS" Comma
"Courier";
However, it then processes 60-latin.conf, which overrides my choices by
prepending again the ones in that configuration file, including the infamous
Noto:
Add Rule(kind:0, name: /etc/fonts/conf.d/60-latin.conf) [test]
pattern any family Equal(ignore blanks) "serif"
[edit]
Edit family Prepend "Noto Serif" Comma "DejaVu Serif" Comma "Times New
Roman" Comma "Thorndale AMT" Comma "Luxi Serif" Comma "Nimbus Roman No9 L"
Comma "Nimbus Roman" Comma "Times";
Add Rule(kind:0, name: /etc/fonts/conf.d/60-latin.conf) [test]
pattern any family Equal(ignore blanks) "sans-serif"
[edit]
Edit family Prepend "Noto Sans" Comma "DejaVu Sans" Comma "Verdana"
Comma "Arial" Comma "Albany AMT" Comma "Luxi Sans" Comma "Nimbus Sans L" Comma
"Nimbus Sans" Comma "Helvetica" Comma "Lucida Sans Unicode" Comma "BPG Glaho
International" Comma "Tahoma";
Add Rule(kind:0, name: /etc/fonts/conf.d/60-latin.conf) [test]
pattern any family Equal(ignore blanks) "monospace"
[edit]
Edit family Prepend "DejaVu Sans Mono" Comma "Noto Mono" Comma "Noto
Sans Mono" Comma "Inconsolata" Comma "Andale Mono" Comma "Courier New" Comma
"Cumberland AMT" Comma "Luxi Mono" Comma "Nimbus Mono L" Comma "Nimbus Mono"
Comma "Nimbus Mono PS" Comma "Courier";
This completely overrides my configuration, which defeats the purpose of having
a user configuration in the first place! It happens no matter where I put it,
in the fonts.conf in my home folder, or in the system wide local.conf.
The only way to solve this is either:
- removing all noto fonts
- editing 60-latin.conf to remove the Noto fonts
I believe this is a bug in the package, since the user configuration should
override the system configuration as intended. I recently upgraded and re-
installed Debian, and this did not occur in my system. I'm not sure what
changed.
-- System Information:
Debian Release: 12.2
APT prefers stable-security
APT policy: (710, 'stable-security'), (700, 'stable'), (650, 'testing'), (600, 'unstable'), (550, 'experimental'), (500, 'stable-updates')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.6.2-botto+ (SMP w/20 CPU threads; PREEMPT)
Kernel taint flags: TAINT_RANDSTRUCT
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages fontconfig depends on:
ii fontconfig-config 2.14.2-6
ii libc6 2.37-12
ii libfontconfig1 2.14.2-6
ii libfreetype6 2.13.2+dfsg-1
fontconfig recommends no packages.
fontconfig suggests no packages.
-- no debconf information
More information about the Pkg-freedesktop-maintainers
mailing list