Many of the fonts, including those from the package manager (currently running a Arch System) don't include the generic family as "serif", "monospace" and "cursive". So I have to indicate the correct family manually (see also https://eev.ee/blog/2015/05/20/i-stared-into-the-fontconfig-and-the-fontconfig-stared-back-at-me/).
But for "monospace" fonts, there's a workaround: they all have the spacing property of 100. You can check this by running fc-list :spacing=100
(see also https://unix.stackexchange.com/a/363368/473666). So the idea is to automatically set every font with this property value as a "monospace" font.
As an example, in the default configuration files and documentation, they set every font that don't have "serif" and "monospace" as "sans-serif" this way:
<match target="pattern">
<test qual="all" name="family" compare="not_eq">
<string>sans-serif</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>serif</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>monospace</string>
</test>
<edit name="family" mode="append_last">
<string>sans-serif</string>
</edit>
</match>
So, I tried this:
<match target="pattern">
<test qual="all" name="spacing" compare="eq">
<int>100</int>
</test>
<test qual="all" name="family" compare="not_eq">
<string>monospace</string>
</test>
<edit name="family" mode="append_last">
<string>monospace</string>
</edit>
</match>
The result: EVERY font on the system is now monospace. This also happens changing <int>100</int>
for <const>mono</const>
. I already read the man fonts.conf
and many of the default configuration files listed in fc-conflist
but I couldn't make it work. I tried multiple combinations of properties and their values, but the result always is either NONE or EVERY font is treated as monospace.
For now, I used this command to generate a list of sources and added them all manually: fc-list :spacing=100 | awk -F: '{print $2}' | sort -u
. This is my first time asking something in Stack Exchange, I hope I managed to make it clear.