Fontconfig from /etc/fonts/fonts.conf diverges from fc-match

Report Bugs, Issues and non- package Requests
Message
Author
igo
Posts: 13
Joined: Mon Dec 31, 2018 6:17 pm

Fontconfig from /etc/fonts/fonts.conf diverges from fc-match

#1 Post by igo »

After configure fonts in /etc/fonts/fonts.conf and execute dpkg-reconfigure fontconfig, system cannot list correct fonts with fc-match.

DejaVu is aways prefered in many cases. Noto is aways ignored.

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
	<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
		<its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
	</its:rules>

	<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/X11R6/lib/X11/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>

<!--
  Ignore dpkg temporary files created in fonts directories
-->
	<selectfont>
		<rejectfont>
			<glob>*.dpkg-tmp</glob>
		</rejectfont>
	</selectfont>
	<selectfont>
		<rejectfont>
			<glob>*.dpkg-new</glob>
		</rejectfont>
	</selectfont>

<!--
  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>

<!-- Generic name aliasing -->
<alias>
    <family>sans-serif</family>
    <prefer>
        <family>Noto Sans</family>
    <family>Liberation Sans</family>
    <family>DejaVu Sans</family>
    </prefer>
</alias>
<alias>
    <family>serif</family>
    <prefer>
        <family>Noto Serif</family>
    <family>Liberation Serif</family>
    <family>DejaVu Serif</family>
    </prefer>
</alias>

<alias>
    <family>monospace</family>
    <prefer>
<family>Hack</family>
<family>Fira Code</family>
<family>Noto Mono</family>
    <family>Liberation Mono</family>
    <family>DejaVu Sans Mono</family>
    </prefer>
</alias>

<alias binding="same">
    <family>monospace</family>
    <accept>
<family>Hack</family>
<family>Fira Code</family>
<family>Noto Mono</family>
    <family>Liberation Mono</family>
    <family>DejaVu Sans Mono</family>
    </accept>
</alias>

<alias binding="same">
  <family>Tahoma</family>
  <prefer>
    <family>Open Sans</family>
  </prefer>
</alias>

<!-- Prevent Gnome from using embedded bitmaps in fonts like Calibri -->
<match target="font">
    <edit name="embeddedbitmap" mode="assign">
        <bool>false</bool>
    </edit>
</match>


<!-- Replace generic bitmap font names by generic font families.
These font-families will get replaced by other rules and
default to scaled ones. -->
<match target="pattern">
    <test qual="any" name="family" compare="eq">
        <string>Helvetica</string>
    </test>
    <edit name="family" mode="assign">
        <string>Arial</string>
        <string>Liberation Sans</string>
        <string>sans-serif</string>
    </edit>
</match>


<!--  Prefer outline e.g. TrueType instead of bitmap fonts
 Check user preference to avoid bitmap fonts and replace
 bitmap face names with equivalent scalable fonts
 -->
<match target="font">
    <edit name="prefer_outline">
        <bool>true</bool>
    </edit>
</match>


</fontconfig>

Code: Select all

$ for font in sans-serif serif mono tahoma helvetica calibri; do echo ">> ${font}:" && echo "$(fc-match -s ${font}|head -n5)" && printf "\n" ; done
>> sans-serif:
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSans-Bold.ttf: "DejaVu Sans" "Bold"
DejaVuSans-Oblique.ttf: "DejaVu Sans" "Oblique"
DejaVuSans-BoldOblique.ttf: "DejaVu Sans" "Bold Oblique"
Verdana.ttf: "Verdana" "Regular"

>> serif:
DejaVuSerif.ttf: "DejaVu Serif" "Book"
DejaVuSerif-Bold.ttf: "DejaVu Serif" "Bold"
DejaVuSerif-Italic.ttf: "DejaVu Serif" "Italic"
DejaVuSerif-BoldItalic.ttf: "DejaVu Serif" "Bold Italic"
Times_New_Roman.ttf: "Times New Roman" "Regular"

>> mono:
Hack-Regular.ttf: "Hack" "Regular"
Hack-Bold.ttf: "Hack" "Bold"
FiraCode-Regular.otf: "Fira Code" "Regular"
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

>> tahoma:
tahoma.ttf: "Tahoma" "Regular"
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSans-Bold.ttf: "DejaVu Sans" "Bold"
DejaVuSans-Oblique.ttf: "DejaVu Sans" "Oblique"
DejaVuSans-BoldOblique.ttf: "DejaVu Sans" "Bold Oblique"

>> helvetica:
Arial.ttf: "Arial" "Regular"
LiberationSans-Regular.ttf: "Liberation Sans" "Regular"
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSans-Bold.ttf: "DejaVu Sans" "Bold"
DejaVuSans-Oblique.ttf: "DejaVu Sans" "Oblique"

>> calibri:
calibri.ttf: "Calibri" "Regular"
Carlito-Regular.ttf: "Carlito" "Regular"
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSans-Bold.ttf: "DejaVu Sans" "Bold"
DejaVuSans-Oblique.ttf: "DejaVu Sans" "Oblique"


$ cat /home/igo/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<channel name="xsettings" version="1.0">
  <property name="Net" type="empty">
    <property name="ThemeName" type="string" value="Greybird-mx"/>
    <property name="IconThemeName" type="string" value="Papirus"/>
    <property name="DoubleClickTime" type="empty"/>
    <property name="DoubleClickDistance" type="empty"/>
    <property name="DndDragThreshold" type="empty"/>
    <property name="CursorBlink" type="empty"/>
    <property name="CursorBlinkTime" type="empty"/>
    <property name="SoundThemeName" type="string" value="Borealis"/>
    <property name="EnableEventSounds" type="empty"/>
    <property name="EnableInputFeedbackSounds" type="empty"/>
  </property>
  <property name="Xft" type="empty">
    <property name="DPI" type="empty"/>
    <property name="Antialias" type="int" value="1"/>
    <property name="Hinting" type="int" value="1"/>
    <property name="HintStyle" type="string" value="hintslight"/>
    <property name="RGBA" type="string" value="rgb"/>
    <property name="Lcdfilter" type="string" value="lcddefault"/>
  </property>
  <property name="Gtk" type="empty">
    <property name="CanChangeAccels" type="empty"/>
    <property name="ColorPalette" type="empty"/>
    <property name="FontName" type="string" value="Noto Sans 10.5"/>
    <property name="MonospaceFontName" type="empty"/>
    <property name="IconSizes" type="empty"/>
    <property name="KeyThemeName" type="empty"/>
    <property name="ToolbarStyle" type="empty"/>
    <property name="ToolbarIconSize" type="empty"/>
    <property name="MenuImages" type="empty"/>
    <property name="ButtonImages" type="empty"/>
    <property name="MenuBarAccel" type="empty"/>
    <property name="CursorThemeName" type="empty"/>
    <property name="CursorThemeSize" type="empty"/>
    <property name="DecorationLayout" type="empty"/>
  </property>
  <property name="Gdk" type="empty">
    <property name="WindowScalingFactor" type="empty"/>
  </property>
</channel>

Code: Select all

$ FC_DEBUG=1024 featherpad
FC_DEBUG=1024
	Loading config file from /etc/fonts/fonts.conf
	Scanning config dir /etc/fonts/conf.d
	Loading config file from /etc/fonts/conf.d/10-hinting-slight.conf
	Loading config file from /etc/fonts/conf.d/10-hinting-slight.conf done
	Loading config file from /etc/fonts/conf.d/10-scale-bitmap-fonts.conf
	Loading config file from /etc/fonts/conf.d/10-scale-bitmap-fonts.conf done
	Loading config file from /etc/fonts/conf.d/11-lcdfilter-default.conf
	Loading config file from /etc/fonts/conf.d/11-lcdfilter-default.conf done
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-lgc-sans-mono.conf
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-lgc-sans-mono.conf done
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-lgc-sans.conf
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-lgc-sans.conf done
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-lgc-serif.conf
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-lgc-serif.conf done
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf done
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf done
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf
	Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf done
	Loading config file from /etc/fonts/conf.d/20-unhint-small-vera.conf
	Loading config file from /etc/fonts/conf.d/20-unhint-small-vera.conf done
	Loading config file from /etc/fonts/conf.d/30-0-google-crosextra-carlito-fontconfig.conf
	Loading config file from /etc/fonts/conf.d/30-0-google-crosextra-carlito-fontconfig.conf done
	Loading config file from /etc/fonts/conf.d/30-metric-aliases.conf
	Loading config file from /etc/fonts/conf.d/30-metric-aliases.conf done
	Loading config file from /etc/fonts/conf.d/30-opensymbol.conf
	Loading config file from /etc/fonts/conf.d/30-opensymbol.conf done
	Loading config file from /etc/fonts/conf.d/40-nonlatin.conf
	Loading config file from /etc/fonts/conf.d/40-nonlatin.conf done
	Loading config file from /etc/fonts/conf.d/45-Hack.conf
	Loading config file from /etc/fonts/conf.d/45-Hack.conf done
	Loading config file from /etc/fonts/conf.d/45-generic.conf
	Loading config file from /etc/fonts/conf.d/45-generic.conf done
	Loading config file from /etc/fonts/conf.d/45-latin.conf
	Loading config file from /etc/fonts/conf.d/45-latin.conf done
	Loading config file from /etc/fonts/conf.d/49-sansserif.conf
	Loading config file from /etc/fonts/conf.d/49-sansserif.conf done
	Loading config file from /etc/fonts/conf.d/50-enable-terminus.conf
	Loading config file from /etc/fonts/conf.d/50-enable-terminus.conf done
	Loading config file from /etc/fonts/conf.d/50-user.conf
	Scanning config dir /home/igo/.config/fontconfig/conf.d
	Loading config file from /etc/fonts/conf.d/50-user.conf done
	Loading config file from /etc/fonts/conf.d/51-local.conf
	Loading config file from /etc/fonts/conf.d/51-local.conf done
	Loading config file from /etc/fonts/conf.d/57-dejavu-sans-mono.conf
	Loading config file from /etc/fonts/conf.d/57-dejavu-sans-mono.conf done
	Loading config file from /etc/fonts/conf.d/57-dejavu-sans.conf
	Loading config file from /etc/fonts/conf.d/57-dejavu-sans.conf done
	Loading config file from /etc/fonts/conf.d/57-dejavu-serif.conf
	Loading config file from /etc/fonts/conf.d/57-dejavu-serif.conf done
	Loading config file from /etc/fonts/conf.d/58-dejavu-lgc-sans-mono.conf
	Loading config file from /etc/fonts/conf.d/58-dejavu-lgc-sans-mono.conf done
	Loading config file from /etc/fonts/conf.d/58-dejavu-lgc-sans.conf
	Loading config file from /etc/fonts/conf.d/58-dejavu-lgc-sans.conf done
	Loading config file from /etc/fonts/conf.d/58-dejavu-lgc-serif.conf
	Loading config file from /etc/fonts/conf.d/58-dejavu-lgc-serif.conf done
	Loading config file from /etc/fonts/conf.d/60-generic.conf
	Loading config file from /etc/fonts/conf.d/60-generic.conf done
	Loading config file from /etc/fonts/conf.d/60-latin.conf
	Loading config file from /etc/fonts/conf.d/60-latin.conf done
	Loading config file from /etc/fonts/conf.d/65-fonts-persian.conf
	Loading config file from /etc/fonts/conf.d/65-fonts-persian.conf done
	Loading config file from /etc/fonts/conf.d/65-nonlatin.conf
	Loading config file from /etc/fonts/conf.d/65-nonlatin.conf done
	Loading config file from /etc/fonts/conf.d/65-wqy-microhei.conf
	Loading config file from /etc/fonts/conf.d/65-wqy-microhei.conf done
	Loading config file from /etc/fonts/conf.d/69-unifont.conf
	Loading config file from /etc/fonts/conf.d/69-unifont.conf done
	Loading config file from /etc/fonts/conf.d/70-no-bitmaps.conf
	Loading config file from /etc/fonts/conf.d/70-no-bitmaps.conf done
	Loading config file from /etc/fonts/conf.d/80-delicious.conf
	Loading config file from /etc/fonts/conf.d/80-delicious.conf done
	Loading config file from /etc/fonts/conf.d/90-synthetic.conf
	Loading config file from /etc/fonts/conf.d/90-synthetic.conf done
	Loading config file from /etc/fonts/fonts.conf done
	Scanning config dir /usr/share/fontconfig/conf.avail
	Scanning config file from /usr/share/fontconfig/conf.avail/10-autohint.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/10-autohint.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/10-hinting-full.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/10-hinting-full.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/10-hinting-medium.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/10-hinting-medium.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/10-hinting-none.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/10-hinting-none.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/10-no-sub-pixel.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/10-no-sub-pixel.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/10-sub-pixel-bgr.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/10-sub-pixel-bgr.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/10-sub-pixel-vbgr.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/10-sub-pixel-vbgr.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/10-sub-pixel-vrgb.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/10-sub-pixel-vrgb.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/10-unhinted.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/10-unhinted.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/11-lcdfilter-legacy.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/11-lcdfilter-legacy.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/11-lcdfilter-light.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/11-lcdfilter-light.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/25-unhint-nonlatin.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/25-unhint-nonlatin.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/65-khmer.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/65-khmer.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/70-force-bitmaps.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/70-force-bitmaps.conf done
	Scanning config file from /usr/share/fontconfig/conf.avail/70-yes-bitmaps.conf
	Scanning config file from /usr/share/fontconfig/conf.avail/70-yes-bitmaps.conf done
What is wrong?

Return to “Bugs and Non-Package Requests Forum”