解决centos chrome浏览器页面中文显示为方框

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  

原文地址:https://www.cnblogs.com/shengs/p/11329078.html