Gangmax Blog

Change Ubuntu 16.04 default Chinese font

Ubuntu Xenial(16.04) uses the “Noto Sans CJK“ font for CJK language including Chinese by default. However, this font is ugly for Chinese characters. To change it, do the following steps(from here and here):

Added on 2017-10-23: This issue also exists on Ubuntu 17.10 and the fix here works as well.

Added on 2018-05-16: This issue also exists on Ubuntu 18.04 and the fix here works as well.

Edit the “/etc/fonts/conf.d/64-language-selector-prefer.conf” file

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
# Move the "SC" items before the "JP" items: change the following content:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans CJK JP</family>
<family>Noto Sans CJK SC</family>
<family>Noto Sans CJK TC</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Sans Mono CJK JP</family>
<family>Noto Sans Mono CJK SC</family>
<family>Noto Sans Mono CJK TC</family>
</prefer>
</alias>
</fontconfig>
# to:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans CJK SC</family>
<family>Noto Sans CJK TC</family>
<family>Noto Sans CJK JP</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Sans Mono CJK SC</family>
<family>Noto Sans Mono CJK TC</family>
<family>Noto Sans Mono CJK JP</family>
</prefer>
</alias>
</fontconfig>

Edit the “/etc/fonts/conf.d/69-language-selector-zh-cn.conf” file

1
2
3
4
5
6
# Add the following font item to the "serif" section before other items:
<string>WenQuanYi Micro Hei</string>
# Add the following font item to the "sans-serif" section before other items:
<string>WenQuanYi Micro Hei</string>
# Add the following font item to the "monospace" section before other items:
<string>WenQuanYi Micro Hei Mono</string>

Now open a new terminal and vi some text with Chinese in it, you should see the new font.

Comments