Archlinux下安装过wps之后字体发虚的问题

Office 是 Linux 永远的痛...微软的 Office 市场霸主地位是根本无法撼动的... 但是微软那家伙很讨厌 Linux 和开源... Office 产品目前也只有 Windows 和 Mac 据说微软要出 Linux 版本的 Office...但是不知道猴年马月啊 (望天

之所以字体发虚是因为安装 WPS 之后的方正字体使得 Sans 和 Sans-Serif 字体的中文部分默认指向了方正宋体.所以导致个这个问题的发生... 左边是微米黑,右边是装过 WPS 之后映射的宋体字.... 明显右边太难看了有木有!!! 解决方案是自己编写 fonts.conf 设置字体的优先级...
文泉驿提供了一个在线配置生成工具 (opens new window) 这个网页有部分 JS 资源被墙了,所以需要科学上网才能正常使用,需要注意. 配置完成之后点上面的“生成[create]”按钮,将结果复制保存到~/.fonts.conf 就能覆盖系统的字体选择顺序. 注意上面的方法在 Archlinux 下会出现警告错误提示是过时的使用方法. 正确的解决办法是把配置文件写在 /etc/fonts/conf.avail/50-user.conf 这样就可以完美解决字体发虚的问题了.

下面贴一下我的配置方案:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- created by WenQuanYi FcDesigner v0.5 -->
<match>
  <test name="family"><string>Arial</string></test>
  <edit name="family" mode="prepend" binding="strong">
    <string>文泉驿微米黑</string>
      <!-- Please install 文泉驿微米黑 first -->
    <string>文泉驿等宽微米黑</string>
    <string>DejaVu Sans</string>
    <string>DejaVu Sans</string>
    <string>WenQuanYi Micro Hei</string>
      <!-- Please install WenQuanYi Micro Hei first -->
    <string>WenQuanYi Zen Hei</string>
    <string>Liberation Sans</string>
    <string>Droid Sans</string>
    <string>WenQuanYi Bitmap Song</string>
      <!-- Please install WenQuanYi Bitmap Song first -->
    <string>Cantarell</string>
      <!-- Please install Cantarell first -->
    <string>DejaVu Sans Condensed</string>
    <string>DejaVu Sans Light</string>
    <string>DejaVu Sans Mono</string>
    <string>DejaVu Serif</string>
    <string>DejaVu Serif Condensed</string>
    <string>方正书宋_GBK</string>
    <string>方正仿宋_GBK</string>
    <string>方正姚体_GBK</string>
    <string>方正宋体S-超大字符集</string>
    <string>方正宋体S-超大字符集(SIP)</string>
      <!-- Please install 方正宋体S-超大字符集(SIP) first -->
    <string>方正小标宋_GBK</string>
    <string>方正楷体_GBK</string>
    <string>方正细黑一_GBK</string>
    <string>方正行楷_GBK</string>
    <string>方正超粗黑_GBK</string>
    <string>方正隶书_GBK</string>
    <string>方正魏碑_GBK</string>
    <string>方正黑体_GBK</string>
  </edit>
</match>
<match>
  <test name="family"><string>sans-serif</string></test>
  <edit name="family" mode="prepend" binding="strong">
    <string>文泉驿微米黑</string>
      <!-- Please install 文泉驿微米黑 first -->
    <string>文泉驿等宽微米黑</string>
    <string>DejaVu Sans</string>
    <string>DejaVu Sans</string>
    <string>WenQuanYi Micro Hei</string>
      <!-- Please install WenQuanYi Micro Hei first -->
    <string>WenQuanYi Zen Hei</string>
    <string>Liberation Sans</string>
    <string>Droid Sans</string>
    <string>WenQuanYi Bitmap Song</string>
      <!-- Please install WenQuanYi Bitmap Song first -->
    <string>Cantarell</string>
      <!-- Please install Cantarell first -->
    <string>DejaVu Sans Condensed</string>
    <string>DejaVu Sans Light</string>
    <string>DejaVu Sans Mono</string>
    <string>DejaVu Serif</string>
    <string>DejaVu Serif Condensed</string>
    <string>方正书宋_GBK</string>
    <string>方正仿宋_GBK</string>
    <string>方正姚体_GBK</string>
    <string>方正宋体S-超大字符集</string>
    <string>方正宋体S-超大字符集(SIP)</string>
      <!-- Please install 方正宋体S-超大字符集(SIP) first -->
    <string>方正小标宋_GBK</string>
    <string>方正楷体_GBK</string>
    <string>方正细黑一_GBK</string>
    <string>方正行楷_GBK</string>
    <string>方正超粗黑_GBK</string>
    <string>方正隶书_GBK</string>
    <string>方正魏碑_GBK</string>
    <string>方正黑体_GBK</string>
  </edit>
</match>
<match>
  <test name="family"><string>serif</string></test>
  <edit name="family" mode="prepend" binding="strong">
    <string>文泉驿微米黑</string>
      <!-- Please install 文泉驿微米黑 first -->
    <string>文泉驿等宽微米黑</string>
    <string>DejaVu Sans</string>
    <string>DejaVu Serif</string>
    <string>WenQuanYi Bitmap Song</string>
      <!-- Please install WenQuanYi Bitmap Song first -->
    <string>AR PL UMing CN</string>
      <!-- Please install AR PL UMing CN first -->
    <string>AR PL SungtiL GB</string>
      <!-- Please install AR PL SungtiL GB first -->
    <string>WenQuanYi Zen Hei Sharp</string>
      <!-- Please install WenQuanYi Zen Hei Sharp first -->
    <string>AR PL UMing TW</string>
      <!-- Please install AR PL UMing TW first -->
    <string>Liberation Serif</string>
      <!-- Please install Liberation Serif first -->
    <string>Bitstream Charter</string>
      <!-- Please install Bitstream Charter first -->
    <string>Droid Serif</string>
      <!-- Please install Droid Serif first -->
    <string>Cantarell</string>
      <!-- Please install Cantarell first -->
    <string>DejaVu Sans Condensed</string>
    <string>DejaVu Sans Light</string>
    <string>DejaVu Sans Mono</string>
    <string>DejaVu Serif</string>
    <string>DejaVu Serif Condensed</string>
    <string>方正书宋_GBK</string>
    <string>方正仿宋_GBK</string>
    <string>方正姚体_GBK</string>
    <string>方正宋体S-超大字符集</string>
    <string>方正宋体S-超大字符集(SIP)</string>
      <!-- Please install 方正宋体S-超大字符集(SIP) first -->
    <string>方正小标宋_GBK</string>
    <string>方正楷体_GBK</string>
    <string>方正细黑一_GBK</string>
    <string>方正行楷_GBK</string>
    <string>方正超粗黑_GBK</string>
    <string>方正隶书_GBK</string>
    <string>方正魏碑_GBK</string>
    <string>方正黑体_GBK</string>
  </edit>
</match>
<match>
  <test name="family"><string>monospace</string></test>
  <edit name="family" mode="prepend" binding="strong">
    <string>文泉驿微米黑</string>
      <!-- Please install 文泉驿微米黑 first -->
    <string>文泉驿等宽微米黑</string>
    <string>DejaVu Sans</string>
    <string>WenQuanYi Zen Hei Mono</string>
      <!-- Please install WenQuanYi Zen Hei Mono first -->
    <string>WenQuanYi Micro Hei Mono</string>
    <string>DejaVu Sans Mono</string>
    <string>Droid Sans Mono</string>
      <!-- Please install Droid Sans Mono first -->
    <string>WenQuanYi Zen Hei Sharp</string>
      <!-- Please install WenQuanYi Zen Hei Sharp first -->
    <string>Liberation Sans Mono</string>
      <!-- Please install Liberation Sans Mono first -->
    <string>AR PL UMing TW</string>
      <!-- Please install AR PL UMing TW first -->
    <string>Cantarell</string>
      <!-- Please install Cantarell first -->
    <string>DejaVu Sans Condensed</string>
    <string>DejaVu Sans Light</string>
    <string>DejaVu Sans Mono</string>
    <string>DejaVu Serif</string>
    <string>DejaVu Serif Condensed</string>
    <string>方正书宋_GBK</string>
    <string>方正仿宋_GBK</string>
    <string>方正姚体_GBK</string>
    <string>方正宋体S-超大字符集</string>
    <string>方正宋体S-超大字符集(SIP)</string>
      <!-- Please install 方正宋体S-超大字符集(SIP) first -->
    <string>方正小标宋_GBK</string>
    <string>方正楷体_GBK</string>
    <string>方正细黑一_GBK</string>
    <string>方正行楷_GBK</string>
    <string>方正超粗黑_GBK</string>
    <string>方正隶书_GBK</string>
    <string>方正魏碑_GBK</string>
    <string>方正黑体_GBK</string>
  </edit>
</match>
</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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170