解決centos chrome瀏覽器頁面中文顯示爲方框

一、系統:centos 7chrome

下載宋體文件:點擊下載centos

把文件放到 /usr/share/fonts/simsun.ttccentos7

依次執行以下命令ip

mkfontdir
mkfontscale
fc-cache -fvget

如下顯示操做成功it

執行下面的命令查看安裝的中文語言class

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=Regularphantomjs

https://www.aityp.com/centos7%E5%AE%89%E8%A3%85%E4%B8%AD%E6%96%87%E5%AE%8B%E4%BD%93-phantomjs/map

 

 

二、centos安裝完成後在chrome中全部中文都顯示爲方框,解決辦法:執行以下三條命令下載

yum groupinstall "X Window System" -y  

yum -y groupinstall chinese-support  

yum -y groupinstall Fonts  

相關文章
相關標籤/搜索