在linux下添加支援中文字型,中文字型的擷取可以從windows平台的字型庫中找到,windows下的C:\windows\fonts下面有你想要的字型,比如simsun.ttc<簡體中文>等字型。centos下的字型庫存放位置:/usr/share/fonts具體操作步驟:================================1.在/usr/share/fonts/chinese檔案夾下建立一個檔案夾(windows)[root@localhost~]#mkdir/usr/share/fonts/chinese/windows2.把從windows中找出的字型複製到windows檔案夾中,再為windows檔案夾更改許可權[root@localhost~]#chmod-R755/usr/share/fonts/chinese/windows3.在字型目錄<windows>中執行ttmkfdir命令[root@localhostwindows]#ttmkfdir-e/usr/share/X11/fonts/encodings/encodings.dir
4.更改fonts.conf檔案[root@localhost~]#vi/etc/fonts/fonts.conf然後添加如下一行;
/usr/share/fonts/chinese/windows添加位置如下:
<!--Fontdirectorylist-->
<dir>/usr/share/fonts/chinese/windows</dir>#新加內容
<dir>/usr/share/fonts</dir>5.重啟xfs伺服器[root@localhost~]#servicexfsrestart6.查看字型有沒有添加成功[root@localhost~]#fc-list:lang=zh-cn
新宋體,NSimSun:style=Regular
宋體,SimSun:style=Regular#字型添加成功
文鼎PL中楷Uni,ARPLZenKaiUni:style=Medium
文鼎PL細上海宋Uni,ARPLShanHeiSunUni,文鼎PL細上海宋Uni:style=Regular至此,在linux添加支援中文字型成功