加粗样式[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@localhost ~]# yum install fontconfig
Package fontconfig-2.13.0-4.3.el7.x86_64 already installed and latest version
Nothing to do
[root@localhost ~]# mkfontscale
-bash: mkfontscale: command not found
如果该命令没有需要安装
[root@localhost ~]# yum install mkfontscale
[root@localhost ~]# mkfontscale
[root@localhost ~]# fc-list :lang=zh
一般情况是没有的
[root@localhost ~]# ls
anaconda-ks.cfg fonts.scale
jdk-8u333-linux-x64.tar.gz node-v14.13.1-linux-x64 node-v14.13.1-linux-x64.tar test
[root@localhost ~]# fc-list
可以看到很多字体但是没有中文
[root@localhost ~]# cd usr/share/fonts
-bash: cd: usr/share/fonts: No such file or directory
[root@localhost ~]# cd /usr/share/fonts
[root@localhost fonts]# ls
dejavu liberation
[root@localhost fonts]# mkdir chinese
[root@localhost fonts]# ls
chinese dejavu liberation
[root@localhost fonts]# ls
chinese dejavu liberation
[root@localhost fonts]# pwd
/usr/share/fonts
[root@localhost fonts]# cd chinese/
[root@localhost chinese]# cd ~
[root@localhost ~]# cp fonts.scale /usr/share/fonts/chinese/
[root@localhost chinese]# sudo chmod -R 755 /usr/share/fonts/chinese
cd /usr/share/fonts/Chinese
[root@localhost chinese]# mkfontscale
[root@localhost chinese]# mkfontdir
[root@localhost chinese]# fc-cache
[root@localhost chinese]#
[root@localhost chinese]# fc-list :lang=zh
fc-list :lang=zh 注意冒号前有空格!
大功告成