You are not logged in.
Pages: 1
Recently I found I needed noto fonts and installed them .
Unfortunately my default fonts according to fc-match are now noto fonts.
I've looked at wiki pages and it should be possible to use /etc/fonts/local.conf to change that, but it's unclear to me how .
The examples on https://wiki.archlinux.org/title/Font_c … ault_fonts change way to much for my purpose.
I want system default monospace to be adobe sourcecode pro, serif and sans to be dejavu .
What should I put in local.conf to achieve that ?
Last edited by Lone_Wolf (2022-04-08 09:37:10)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Here is mine ~/.config/fontconfig/fonts.conf:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="pattern">
<test name="family" qual="any">
<string>sans-serif</string>
</test>
<edit mode="assign" name="family" binding="same">
<string>Liberation Sans</string>
</edit>
</match>
<match target="pattern">
<test name="family" qual="any">
<string>serif</string>
</test>
<edit mode="assign" name="family" binding="same">
<string>Liberation Serif</string>
</edit>
</match>
<match target="pattern">
<test name="family" qual="any">
<string>monospace</string>
</test>
<edit mode="assign" name="family" binding="same">
<string>Liberation Mono</string>
</edit>
</match>
</fontconfig>
Last edited by Fixxer (2022-04-07 10:03:36)
Offline
The examples on https://wiki.archlinux.org/title/Font_c … ault_fonts change way to much for my purpose.
That section has only language-specific examples, but it starts with a link to https://wiki.archlinux.org/title/Metric … ible_fonts
From that page, I think you want something like https://wiki.archlinux.org/title/Metric … ing_method
Offline
Here's my ~/.config/fontconfig/fonts.conf:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
<description>Local settings</description>
<!-- filter out wanted fonts - section disabled
That means ALL FONTS ALLOWED
<selectfont>
<rejectfont>
<glob>/usr/share/fonts/noto/Noto*</glob>
<glob>/usr/share/fonts/noto-cjk/Noto*</glob>
<glob>/usr/share/fonts/gsfonts/*</glob>
<glob>/usr/share/fonts/TTF/*</glob>
<glob>/usr/share/fonts/adobe-source-code-pro/*</glob>
<glob>/usr/share/fonts/liberation/*</glob>
</rejectfont>
<acceptfont>
<glob>/usr/share/fonts/noto/NotoSans-*</glob>
<glob>/usr/share/fonts/noto/NotoSansMono-*</glob>
<glob>/usr/share/fonts/noto/NotoSansDisplay-*</glob>
<glob>/usr/share/fonts/noto/NotoSerif-*</glob>
<glob>/usr/share/fonts/noto/NotoSerifDisplay-*</glob>
<glob>/usr/share/fonts/noto/NotoColorEmoji</glob>
<glob>/usr/share/fonts/gsfonts/NimbusMono*</glob>
<glob>/usr/share/fonts/gsfonts/NimbusRoman*</glob>
<glob>/usr/share/fonts/gsfonts/NimbusSans*</glob>
</acceptfont>
</selectfont>
-->
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif</family>
<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>Noto Sans</family>
<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>Noto Sans Mono</family>
<family>Source Code Pro</family>
<family>DejaVu Sans Mono</family>
<family>Inconsolata</family>
<family>Liberation Mono</family>
<family>Andale Mono</family>
<family>Courier New</family>
<family>Nimbus Mono</family>
<family>Nimbus Mono PS</family>
<family>Courier</family>
</prefer>
</alias>
<!--
Fantasy faces
-->
<alias>
<family>fantasy</family>
<prefer>
<family>Impact</family>
<family>Copperplate Gothic Std</family>
<family>Cooper Std</family>
<family>Bauhaus Std</family>
</prefer>
</alias>
<!--
Cursive faces
-->
<alias>
<family>cursive</family>
<prefer>
<family>ITC Zapf Chancery Std</family>
<family>Zapfino</family>
<family>Comic Sans MS</family>
</prefer>
</alias>
<!--
system-ui
-->
<alias>
<family>system-ui</family>
<prefer>
<family>Cantarell</family>
<family>Noto Sans UI</family>
<family>Segoe UI</family>
<family>Segoe UI Historic</family>
<family>Segoe UI Symbol</family>
</prefer>
</alias>
<dir>~/.fonts</dir>
</fontconfig>
It's a bit of a mess with sections commented out, but it should be fairly sensible.
The answer to your question is the <alias><family></family><prefer></prefer></alias> tags; it will use the first it finds in the list of preferred fonts.
Edit: Here's my default fonts, based on that config:
serif: NotoSerif-Regular.ttf: "Noto Serif" "Regular"
sans-serif: NotoSans-Regular.ttf: "Noto Sans" "Regular"
monospace: NotoSansMono-Regular.ttf: "Noto Sans Mono" "Regular"
I answered quickly and see that you asked for system default, not user default, so my answer is a bit off, but I would think the syntax is similar for /etc/fonts/local.conf.
The source for the configuration above is this wiki section.
Last edited by Ferdinand (2022-04-07 16:23:33)
Offline
Configuration in ~/.config/fontconfig/fonts.conf takes precedence over the one in /etc/fonts/local.conf according to the wiki. In /etc/fonts/conf.d you have the 50-user.conf and 51-local.conf symlinks which load the user config and the system one respectively.
I have achieved something similar to what you desire(using liberation+jetbrains mono with noto fonts installed as well) by writing aliases for sans, serif and monospace in my local configuration, but the syntax for /etc/fonts/local.conf is identical if you wish to configure them system-wide. My ~/.config/fontconfig/fonts.conf:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Liberation Serif</family>
</prefer>
</alias>
<alias>
<family>sans</family>
<prefer>
<family>Liberation Sans</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>JetBrains Mono</family>
</prefer>
</alias>
</fontconfig>
Last edited by schan (2022-04-07 18:14:57)
Offline
Thanks for the responses.
Combining https://wiki.archlinux.org/title/Font_c … ault_fonts and https://wiki.archlinux.org/title/Metric … figuration with your answers made clear how things that work .
This only works if the original font is not in the system, in which case the one specified will be substituted:
That remark from the first wiki link about prefer makes me feel like prefer functions more as a fallback option then as a default setting.
I went with binding for now and it appears to do what I want :
applications that request serif , sans-serif or monospace get the font I have set for that..
apps that request a specific font from installed list lets them use that font.
This is what I have now in /etc/fonts/local.font
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test qual="any" name="family">
<string>
serif
</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>
DejaVu Serif
</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>
sans-serif
</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>
DejaVu Sans
</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>
monospace
</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>
Source Code Pro
</string>
</edit>
</match>
</fontconfig>
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Pages: 1