Linux

如何在CentOS7上安装中文字体

# 安装软件
yum -y install fontconfig

# 我们查看当前系统中已经有的字体
[root@loanapp opt]# fc-list
/usr/share/fonts/dejavu/DejaVuSansCondensed-Oblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique
/usr/share/fonts/dejavu/DejaVuSansCondensed-Bold.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
/usr/share/fonts/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/dejavu/DejaVuSansCondensed.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed,Book
/usr/share/fonts/dejavu/DejaVuSans-ExtraLight.ttf: DejaVu Sans,DejaVu Sans Light:style=ExtraLight
/usr/share/fonts/dejavu/DejaVuSansCondensed-BoldOblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold Oblique,Bold Oblique
/usr/share/fonts/dejavu/DejaVuSans-Oblique.ttf: DejaVu Sans:style=Oblique
/usr/share/fonts/dejavu/DejaVuSans-BoldOblique.ttf: DejaVu Sans:style=Bold Oblique

# 然后切换到这个字体存放目录
cd /usr/share/fonts

# 创建一个我们自定义的目录进去
mkdir Song

# 然后把我们准备好的字体文件上传到这个目录中
STSONG.TTF & simsun.ttc

# 最后,我们刷新字体
fc-cache -fv

注意:有些时候需要重启应用或者服务器才能生效。

原文地址:https://www.cnblogs.com/duchaoqun/p/12667091.html