Centos7.6安装中文字体

Andy 2022年07月05日 667次浏览

1、查看所有字体:

fc-list // 如果提示 fc-list: command not found,则需要安装# yum install fontconfig

2、查看中文字体:

fc-list :lang=zh

如果显示为空,则表示centos系统没有中文字体;

3、找到win10的字体,并复制到其他目录:

C:\Windows\Fonts\微软雅黑

4、把msyh.ttc上传到/usr/share/fonts/目录下,使用如下命令:

cd /opt/font

cp msyh.ttc /usr/share/fonts/

5、建立字体索引信息,更新字体缓存,使用如下命令:

cd /usr/share/fonts/

mkfontscale //如果提示 mkfontscale: command not found,需自行安装 # yum install mkfontscale

mkfontdir

fc-cache //如果提示 fc-cache: command not found,则需要安装# yum install fontconfig

6、查看中文字体是否安装成功:

fc-list :lang=zh