Fix fontconfig monospace binding overriding app-specific fonts (#5700)

Change monospace match from mode="assign" binding="strong" to
mode="append" binding="same" so the system font acts as a fallback
instead of overriding explicit app font configs like Ghostty's font-family.

Add migration to fix existing user configs.

Fixes #5675
This commit is contained in:
René
2026-05-11 10:15:37 +02:00
committed by GitHub
parent 378ba984ca
commit 324c9a4054
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
<test name="family" qual="any">
<string>monospace</string>
</test>
<edit name="family" mode="assign" binding="strong">
<edit name="family" mode="append" binding="same">
<string>JetBrainsMono Nerd Font</string>
</edit>
</match>
+11
View File
@@ -0,0 +1,11 @@
echo "Fix fontconfig monospace binding so app-specific fonts are not overridden"
if [[ -f ~/.config/fontconfig/fonts.conf ]] && command -v xmlstarlet >/dev/null 2>&1; then
xmlstarlet ed -L \
-u '//match[@target="pattern"][test/string="monospace"]/edit[@name="family"]/@mode' \
-v "append" \
-u '//match[@target="pattern"][test/string="monospace"]/edit[@name="family"]/@binding' \
-v "same" \
~/.config/fontconfig/fonts.conf
fc-cache -f >/dev/null 2>&1
fi