一,centos系統默認不支持中文字體的,需要手動安裝windows系統中的中文字體庫到centos中。
首先,將windows系統中的字體拷貝出來:
windows:打開C:\Windows\Fonts
1,查看系統安裝了哪些字體
fc-list (如果沒有此命令,需要yum安裝字體庫)
2,安裝字體庫
yum -y install fontconfig
cd /usr/share/fonts
mkdir chinese
cd chinese
#上傳拷貝出來的windows中文字
chmod -R 755 /usr/share/fonts/chinese
3,安裝ttmkfdir工具
yum -y install ttmkfdir
ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir
4,修改字體配置文件
vim /etc/fonts/fonts.conf
5,保存退出,如果服務器可以重啟的話,就reboot吧。
6,如果無法reboot,可以執行
fc-cache
7,查看是否安裝成功
fc-list
#看到剛上傳的字體即為安裝成功。