引用:linux-config-guide

安装字体

Noto, Noto CJK, Noto Emoji 和 Sarasa Gothic 。

1
2
sudo pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji ttf-sarasa-gothic

下载 fonts.conf

扔进你的 ~/.config/fontconfig 里面, 重新登录,结束。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

<match target="font">
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
</match>

<match target="font">
<edit mode="assign" name="hintstyle">
<const>hintslight</const>
</edit>
</match>

<match target="font">
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
</match>

<!-- Map fonts that are commonly used by web pages to our preferred fonts -->
<match target="pattern">
<test qual="any" name="family"><string>Liberation Sans</string></test>
<edit name="family" mode="assign" binding="same"><string>sans-serif</string></edit>
</match>

<match target="pattern">
<test qual="any" name="family"><string>Liberation Mono</string></test>
<edit name="family" mode="assign" binding="same"><string>monospace</string></edit>
</match>

<!-- Default font for the zh_CN locale (no fc-match pattern) -->
<match>
<test compare="contains" name="lang">
<string>zh_CN</string>
</test>
<edit mode="prepend" name="family">
<string>Noto Sans CJK SC</string>
</edit>
</match>

<!-- Default sans-serif font -->
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string></test>
<edit name="family" mode="prepend" binding="same">
<string>Noto Sans</string>
</edit>
</match>

<!-- Default serif fonts -->
<match target="pattern">
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="same">
<string>Noto Serif</string>
</edit>
</match>

<!-- Default monospace fonts -->
<match target="pattern">
<test qual="any" name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="same">
<string>Sarasa Term SC</string>
</edit>
</match>

<!-- Fallback fonts preference order -->
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans</family>
<family>Noto Sans CJK SC</family>
<family>Noto Sans CJK TC</family>
<family>Noto Sans CJK JP</family>
<family>Noto Sans CJK KR</family>
<family>Noto Color Emoji</family>
<family>Noto Emoji</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif</family>
<family>Noto Serif CJK SC</family>
<family>Noto Serif CJK TC</family>
<family>Noto Serif CJK JP</family>
<family>Noto Serif CJK KR</family>
<family>Noto Color Emoji</family>
<family>Noto Emoji</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Sarasa Term SC</family>
<family>Sarasa Term TC</family>
<family>Sarasa Term J</family>
<family>Noto Color Emoji</family>
<family>Noto Emoji</family>
</prefer>
</alias>

<selectfont>
<rejectfont>
<pattern>
<patelt name="family" >
<!-- This font is causing problem with GitHub -->
<string>Nimbus Sans</string>
</patelt>
</pattern>
</rejectfont>
</selectfont>

</fontconfig>