flake/nixos/profiles/common/graphical/home/fonts/fontconfig/fonts.conf

70 lines
2.9 KiB
XML

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<its:rules version="1.0" xmlns:its="http://www.w3.org/2005/11/its">
<its:translateRule selector="/fontconfig/*[not(self::description)]" translate="no"/>
</its:rules>
<description>trash Font Config 3.0</description>
<!-- Modified version of https://wiki.archlinux.org/title/Font_configuration/Examples#CJK,_but_other_Latin_fonts_are_preferred -->
<!--
(default = true) Use antialias
Disable embedded bitmap fonts
(default = false) Disable autohint
(default = true) Hinting
(default = hintslight) Hint style
RGBA
LCD filter
Set DPI
-->
<match target="font">
<!-- <edit mode="assign" name="antialias"> <bool>true</bool></edit> --> <!-- breaks emoji in GTK, unsure why -->
<edit mode="assign" name="embeddedbitmap"> <bool>false</bool></edit>
<edit mode="assign" name="autohint"> <bool>false</bool></edit>
<edit mode="assign" name="hinting"> <bool>true</bool></edit>
<edit mode="assign" name="hintstyle"> <const>hintslight</const></edit>
<edit mode="assign" name="rgba"> <const>rgb</const></edit>
<edit mode="assign" name="lcdfilter"> <const>lcddefault</const></edit>
<edit mode="assign" name="dpi"> <double>96</double></edit>
</match>
<!-- Latin font -->
<!-- Default serif font -->
<alias binding="strong"><family>serif</family>
<prefer><family>Source Han Serif SC VF</family></prefer></alias>
<!-- Default sans-serif font -->
<alias binding="strong"><family>sans-serif</family>
<prefer><family>Inter</family></prefer></alias>
<!-- Default monospace font -->
<alias binding="strong"><family>monospace</family>
<prefer><family>JetBrainsMono Nerd Font</family></prefer></alias>
<!-- Default system-ui font -->
<alias binding="strong"><family>system-ui</family>
<prefer><family>Inter</family></prefer></alias>
<!-- CJK -->
<!-- Default fonts when the "lang" attribute is not given -->
<!-- You can change this font to the language variant you want -->
<match target="pattern">
<test name="family"><string>serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Serif SC VF</string></edit>
</match>
<match target="pattern">
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans SC VF</string></edit>
</match>
<match target="pattern">
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans SC VF</string></edit>
</match>
<match target="pattern">
<test name="family"><string>system-ui</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans SC VF</string></edit>
</match>
</fontconfig>