1、系統:centos 7
下載宋體文件:點擊下載
把文件放到 /usr/share/fonts/simsun.ttc
依次執行如下命令
mkfontdir
mkfontscale
fc-cache -fv
以下顯示操作成功
執行下面的命令查看安裝的中文語言
fc-list :lang=zh
/usr/share/fonts/simsun.ttc: SimSun,宋體:style=Regular
/usr/share/fonts/bitmap/fangsongti24.pcf.gz: Fangsong ti:style=Regular
/usr/share/fonts/simsun.ttc: NSimSun,新宋體:style=Regular
/usr/share/fonts/bitmap/fangsongti16.pcf.gz: Fangsong ti:style=Regular
https://www.aityp.com/centos7%E5%AE%89%E8%A3%85%E4%B8%AD%E6%96%87%E5%AE%8B%E4%BD%93-phantomjs/
2、centos安裝完成后在chrome中所有中文都顯示為方框,解決辦法:執行如下三條命令
yum groupinstall "X Window System" -y
yum -y groupinstall chinese-support
yum -y groupinstall Fonts