flake/users/guanranwang/home-manager/resources/dotfiles/config/fontconfig/fonts.conf

269 lines
13 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 name="antialias" mode="assign"> <bool>true</bool></edit>
<edit name="embeddedbitmap" mode="assign"> <bool>false</bool></edit>
<edit name="autohint" mode="assign"> <bool>false</bool></edit>
<edit name="hinting" mode="assign"> <bool>true</bool></edit>
<edit name="hintstyle" mode="assign"> <const>hintslight</const></edit>
<edit name="rgba" mode="assign"> <const>rgb</const></edit>
<edit name="lcdfilter" mode="assign"> <const>lcddefault</const></edit>
<edit name="dpi" mode="assign"> <double>96</double></edit>
</match>
<!-- Latin font -->
<!-- Default serif font -->
<alias binding="strong"><family>serif</family>
<prefer><family>Source Han Serif SC</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</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</string></edit>
</match>
<match target="pattern">
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Mono SC</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</string></edit>
</match>
<!-- Chinese -->
<!-- "lang=zh" or "lang=zh-*" -->
<match target="pattern">
<test name="lang" compare="contains"><string>zh</string></test>
<test name="family"><string>serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Serif SC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh</string></test>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans SC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh</string></test>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Mono SC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh</string></test>
<test name="family"><string>system-ui</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans SC</string></edit>
</match>
<!-- Chinese Variants (standard, specified by variants) -->
<!-- "lang=zh-hans" or "lang=zh-hans-*" -->
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hans</string></test>
<test name="family"><string>serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans SC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hans</string></test>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans SC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hans</string></test>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Mono SC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hans</string></test>
<test name="family"><string>system-ui</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans SC</string></edit>
</match>
<!-- "lang=zh-hant" or "lang=zh-hant-*" -->
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hant</string></test>
<test name="family"><string>serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Serif TC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hant</string></test>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans TC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hant</string></test>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Mono TC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hant</string></test>
<test name="family"><string>system-ui</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans TC</string></edit>
</match>
<!-- "lang=zh-hant-hk" or "lang=zh-hant-hk-*" -->
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hant</string></test>
<test name="family"><string>serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Serif HC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hant</string></test>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans HC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hant</string></test>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Mono HC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hant</string></test>
<test name="family"><string>system-ui</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans HC</string></edit>
</match>
<!-- Chinese Compatible (non-standard, specified by country) -->
<!-- "lang=zh-cn" or "lang=zh-cn-*" -->
<match target="pattern">
<test name="lang" compare="contains"><string>zh-cn</string></test>
<test name="family"><string>serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans SC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-cn</string></test>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans SC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-cn</string></test>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Mono SC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-cn</string></test>
<test name="family"><string>system-ui</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans SC</string></edit>
</match>
<!-- "lang=zh-tw" or "lang=zh-tw-*" -->
<match target="pattern">
<test name="lang" compare="contains"><string>zh-tw</string></test>
<test name="family"><string>serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Serif TC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-tw</string></test>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans TC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-tw</string></test>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Mono TC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-tw</string></test>
<test name="family"><string>system-ui</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans TC</string></edit>
</match>
<!-- "lang=zh-hk" or "lang=zh-hk-*" -->
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hk</string></test>
<test name="family"><string>serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Serif HC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hk</string></test>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans HC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hk</string></test>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Mono HC</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>zh-hk</string></test>
<test name="family"><string>system-ui</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans HC</string></edit>
</match>
<!-- Japanese -->
<!-- "lang=ja" or "lang=ja-*" -->
<match target="pattern">
<test name="lang" compare="contains"><string>ja</string></test>
<test name="family"><string>serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Serif</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>ja</string></test>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>ja</string></test>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Mono</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>ja</string></test>
<test name="family"><string>system-ui</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans</string></edit>
</match>
<!-- Korean -->
<!-- "lang=ko" or "lang=ko-*" -->
<match target="pattern">
<test name="lang" compare="contains"><string>ko</string></test>
<test name="family"><string>serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Serif K</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>ko</string></test>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans K</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>ko</string></test>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Mono K</string></edit>
</match>
<match target="pattern">
<test name="lang" compare="contains"><string>ko</string></test>
<test name="family"><string>system-ui</string></test>
<edit name="family" mode="append" binding="strong"><string>Source Han Sans K</string></edit>
</match>
</fontconfig>