fix-linux-cjk.sh
· 343 B · Bash
Brut
set -e
echo "Fixing CJK fonts..."
sudo wget https://gitlab.aiursoft.cn/anduin/anduinos/-/raw/1.0/src/mods/15-fonts-mod/local.conf -O /etc/fonts/local.conf
wget -P /tmp https://gitlab.aiursoft.cn/anduin/anduinos/-/raw/1.0/src/mods/15-fonts-mod/fonts.zip
sudo unzip -o /tmp/fonts.zip -d /usr/share/fonts/
rm -f /tmp/fonts.zip
sudo fc-cache -fv
| 1 | set -e |
| 2 | |
| 3 | echo "Fixing CJK fonts..." |
| 4 | sudo wget https://gitlab.aiursoft.cn/anduin/anduinos/-/raw/1.0/src/mods/15-fonts-mod/local.conf -O /etc/fonts/local.conf |
| 5 | wget -P /tmp https://gitlab.aiursoft.cn/anduin/anduinos/-/raw/1.0/src/mods/15-fonts-mod/fonts.zip |
| 6 | sudo unzip -o /tmp/fonts.zip -d /usr/share/fonts/ |
| 7 | rm -f /tmp/fonts.zip |
| 8 | sudo fc-cache -fv |
| 9 |
fonts.conf
· 5.8 KiB · Text
Brut
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<!-- Default system-ui fonts -->
<match target="pattern">
<test name="family">
<string>system-ui</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>sans-serif</string>
</edit>
</match>
<!-- Default sans-serif fonts-->
<match target="pattern">
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans CJK SC</string>
<string>Noto Sans</string>
<string>Twitter Color Emoji</string>
</edit>
</match>
<!-- Default serif fonts-->
<match target="pattern">
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Serif CJK SC</string>
<string>Noto Serif</string>
<string>Twitter Color Emoji</string>
</edit>
</match>
<!-- Default monospace fonts-->
<match target="pattern">
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans Mono CJK SC</string>
<string>Symbols Nerd Font</string>
<string>Twitter Color Emoji</string>
</edit>
</match>
<match target="pattern">
<test name="prgname" compare="not_eq">
<string>chrome</string>
</test>
<test name="family" compare="contains">
<string>Noto Sans Mono CJK</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Cascadia Code</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-HK</string>
</test>
<test name="family">
<string>Noto Sans CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK HK</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-HK</string>
</test>
<test name="family">
<string>Noto Serif CJK SC</string>
</test>
<edit name="family" binding="strong">
<!-- not have HK -->
<string>Noto Serif CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-HK</string>
</test>
<test name="family">
<string>Noto Sans Mono CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK HK</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-TW</string>
</test>
<test name="family">
<string>Noto Sans CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-TW</string>
</test>
<test name="family">
<string>Noto Serif CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-TW</string>
</test>
<test name="family">
<string>Noto Sans Mono CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ja</string>
</test>
<test name="family">
<string>Noto Sans CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK JP</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ja</string>
</test>
<test name="family">
<string>Noto Serif CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif CJK JP</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ja</string>
</test>
<test name="family">
<string>Noto Sans Mono CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK JP</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ko</string>
</test>
<test name="family">
<string>Noto Sans CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK KR</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ko</string>
</test>
<test name="family">
<string>Noto Serif CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif CJK KR</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ko</string>
</test>
<test name="family">
<string>Noto Sans Mono CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK KR</string>
</edit>
</match>
<!-- Replace monospace fonts -->
<match target="pattern">
<test name="family" compare="contains">
<string>Source Code</string>
</test>
<edit name="family" binding="strong">
<string>Cascadia Code</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>en</string>
</test>
<test name="family" compare="contains">
<string>Noto Sans CJK</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>en</string>
</test>
<test name="family" compare="contains">
<string>Noto Serif CJK</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Serif</string>
</edit>
</match>
</fontconfig>
| 1 | <?xml version="1.0"?> |
| 2 | <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> |
| 3 | <fontconfig> |
| 4 | |
| 5 | <!-- Default system-ui fonts --> |
| 6 | <match target="pattern"> |
| 7 | <test name="family"> |
| 8 | <string>system-ui</string> |
| 9 | </test> |
| 10 | <edit name="family" mode="prepend" binding="strong"> |
| 11 | <string>sans-serif</string> |
| 12 | </edit> |
| 13 | </match> |
| 14 | |
| 15 | <!-- Default sans-serif fonts--> |
| 16 | <match target="pattern"> |
| 17 | <test name="family"> |
| 18 | <string>sans-serif</string> |
| 19 | </test> |
| 20 | <edit name="family" mode="prepend" binding="strong"> |
| 21 | <string>Noto Sans CJK SC</string> |
| 22 | <string>Noto Sans</string> |
| 23 | <string>Twitter Color Emoji</string> |
| 24 | </edit> |
| 25 | </match> |
| 26 | |
| 27 | <!-- Default serif fonts--> |
| 28 | <match target="pattern"> |
| 29 | <test name="family"> |
| 30 | <string>serif</string> |
| 31 | </test> |
| 32 | <edit name="family" mode="prepend" binding="strong"> |
| 33 | <string>Noto Serif CJK SC</string> |
| 34 | <string>Noto Serif</string> |
| 35 | <string>Twitter Color Emoji</string> |
| 36 | </edit> |
| 37 | </match> |
| 38 | |
| 39 | <!-- Default monospace fonts--> |
| 40 | <match target="pattern"> |
| 41 | <test name="family"> |
| 42 | <string>monospace</string> |
| 43 | </test> |
| 44 | <edit name="family" mode="prepend" binding="strong"> |
| 45 | <string>Noto Sans Mono CJK SC</string> |
| 46 | <string>Symbols Nerd Font</string> |
| 47 | <string>Twitter Color Emoji</string> |
| 48 | </edit> |
| 49 | </match> |
| 50 | |
| 51 | <match target="pattern"> |
| 52 | <test name="prgname" compare="not_eq"> |
| 53 | <string>chrome</string> |
| 54 | </test> |
| 55 | <test name="family" compare="contains"> |
| 56 | <string>Noto Sans Mono CJK</string> |
| 57 | </test> |
| 58 | <edit name="family" mode="prepend" binding="strong"> |
| 59 | <string>Cascadia Code</string> |
| 60 | </edit> |
| 61 | </match> |
| 62 | |
| 63 | |
| 64 | <match target="pattern"> |
| 65 | <test name="lang"> |
| 66 | <string>zh-HK</string> |
| 67 | </test> |
| 68 | <test name="family"> |
| 69 | <string>Noto Sans CJK SC</string> |
| 70 | </test> |
| 71 | <edit name="family" binding="strong"> |
| 72 | <string>Noto Sans CJK HK</string> |
| 73 | </edit> |
| 74 | </match> |
| 75 | |
| 76 | <match target="pattern"> |
| 77 | <test name="lang"> |
| 78 | <string>zh-HK</string> |
| 79 | </test> |
| 80 | <test name="family"> |
| 81 | <string>Noto Serif CJK SC</string> |
| 82 | </test> |
| 83 | <edit name="family" binding="strong"> |
| 84 | <!-- not have HK --> |
| 85 | <string>Noto Serif CJK TC</string> |
| 86 | </edit> |
| 87 | </match> |
| 88 | |
| 89 | <match target="pattern"> |
| 90 | <test name="lang"> |
| 91 | <string>zh-HK</string> |
| 92 | </test> |
| 93 | <test name="family"> |
| 94 | <string>Noto Sans Mono CJK SC</string> |
| 95 | </test> |
| 96 | <edit name="family" binding="strong"> |
| 97 | <string>Noto Sans Mono CJK HK</string> |
| 98 | </edit> |
| 99 | </match> |
| 100 | |
| 101 | <match target="pattern"> |
| 102 | <test name="lang"> |
| 103 | <string>zh-TW</string> |
| 104 | </test> |
| 105 | <test name="family"> |
| 106 | <string>Noto Sans CJK SC</string> |
| 107 | </test> |
| 108 | <edit name="family" binding="strong"> |
| 109 | <string>Noto Sans CJK TC</string> |
| 110 | </edit> |
| 111 | </match> |
| 112 | |
| 113 | <match target="pattern"> |
| 114 | <test name="lang"> |
| 115 | <string>zh-TW</string> |
| 116 | </test> |
| 117 | <test name="family"> |
| 118 | <string>Noto Serif CJK SC</string> |
| 119 | </test> |
| 120 | <edit name="family" binding="strong"> |
| 121 | <string>Noto Serif CJK TC</string> |
| 122 | </edit> |
| 123 | </match> |
| 124 | |
| 125 | <match target="pattern"> |
| 126 | <test name="lang"> |
| 127 | <string>zh-TW</string> |
| 128 | </test> |
| 129 | <test name="family"> |
| 130 | <string>Noto Sans Mono CJK SC</string> |
| 131 | </test> |
| 132 | <edit name="family" binding="strong"> |
| 133 | <string>Noto Sans Mono CJK TC</string> |
| 134 | </edit> |
| 135 | </match> |
| 136 | |
| 137 | <match target="pattern"> |
| 138 | <test name="lang"> |
| 139 | <string>ja</string> |
| 140 | </test> |
| 141 | <test name="family"> |
| 142 | <string>Noto Sans CJK SC</string> |
| 143 | </test> |
| 144 | <edit name="family" binding="strong"> |
| 145 | <string>Noto Sans CJK JP</string> |
| 146 | </edit> |
| 147 | </match> |
| 148 | |
| 149 | <match target="pattern"> |
| 150 | <test name="lang"> |
| 151 | <string>ja</string> |
| 152 | </test> |
| 153 | <test name="family"> |
| 154 | <string>Noto Serif CJK SC</string> |
| 155 | </test> |
| 156 | <edit name="family" binding="strong"> |
| 157 | <string>Noto Serif CJK JP</string> |
| 158 | </edit> |
| 159 | </match> |
| 160 | |
| 161 | <match target="pattern"> |
| 162 | <test name="lang"> |
| 163 | <string>ja</string> |
| 164 | </test> |
| 165 | <test name="family"> |
| 166 | <string>Noto Sans Mono CJK SC</string> |
| 167 | </test> |
| 168 | <edit name="family" binding="strong"> |
| 169 | <string>Noto Sans Mono CJK JP</string> |
| 170 | </edit> |
| 171 | </match> |
| 172 | |
| 173 | <match target="pattern"> |
| 174 | <test name="lang"> |
| 175 | <string>ko</string> |
| 176 | </test> |
| 177 | <test name="family"> |
| 178 | <string>Noto Sans CJK SC</string> |
| 179 | </test> |
| 180 | <edit name="family" binding="strong"> |
| 181 | <string>Noto Sans CJK KR</string> |
| 182 | </edit> |
| 183 | </match> |
| 184 | |
| 185 | <match target="pattern"> |
| 186 | <test name="lang"> |
| 187 | <string>ko</string> |
| 188 | </test> |
| 189 | <test name="family"> |
| 190 | <string>Noto Serif CJK SC</string> |
| 191 | </test> |
| 192 | <edit name="family" binding="strong"> |
| 193 | <string>Noto Serif CJK KR</string> |
| 194 | </edit> |
| 195 | </match> |
| 196 | |
| 197 | <match target="pattern"> |
| 198 | <test name="lang"> |
| 199 | <string>ko</string> |
| 200 | </test> |
| 201 | <test name="family"> |
| 202 | <string>Noto Sans Mono CJK SC</string> |
| 203 | </test> |
| 204 | <edit name="family" binding="strong"> |
| 205 | <string>Noto Sans Mono CJK KR</string> |
| 206 | </edit> |
| 207 | </match> |
| 208 | |
| 209 | <!-- Replace monospace fonts --> |
| 210 | <match target="pattern"> |
| 211 | <test name="family" compare="contains"> |
| 212 | <string>Source Code</string> |
| 213 | </test> |
| 214 | <edit name="family" binding="strong"> |
| 215 | <string>Cascadia Code</string> |
| 216 | </edit> |
| 217 | </match> |
| 218 | <match target="pattern"> |
| 219 | <test name="lang" compare="contains"> |
| 220 | <string>en</string> |
| 221 | </test> |
| 222 | <test name="family" compare="contains"> |
| 223 | <string>Noto Sans CJK</string> |
| 224 | </test> |
| 225 | <edit name="family" mode="prepend" binding="strong"> |
| 226 | <string>Noto Sans</string> |
| 227 | </edit> |
| 228 | </match> |
| 229 | |
| 230 | <match target="pattern"> |
| 231 | <test name="lang" compare="contains"> |
| 232 | <string>en</string> |
| 233 | </test> |
| 234 | <test name="family" compare="contains"> |
| 235 | <string>Noto Serif CJK</string> |
| 236 | </test> |
| 237 | <edit name="family" mode="prepend" binding="strong"> |
| 238 | <string>Noto Serif</string> |
| 239 | </edit> |
| 240 | </match> |
| 241 | |
| 242 | </fontconfig> |