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:
@@ -23,7 +23,7 @@
|
|||||||
<test name="family" qual="any">
|
<test name="family" qual="any">
|
||||||
<string>monospace</string>
|
<string>monospace</string>
|
||||||
</test>
|
</test>
|
||||||
<edit name="family" mode="assign" binding="strong">
|
<edit name="family" mode="append" binding="same">
|
||||||
<string>JetBrainsMono Nerd Font</string>
|
<string>JetBrainsMono Nerd Font</string>
|
||||||
</edit>
|
</edit>
|
||||||
</match>
|
</match>
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user