centos 系统字体库安装中文字体

一,centos系统默认不支持中文字体的,需要手动安装windows系统中的中文字体库到centos中。

首先,将windows系统中的字体拷贝出来:

windows:打开C:WindowsFonts

1,查看系统安装了哪些字体

  fc-list   (如果没有此命令,需要yum安装字体库)

2,安装字体库

  yum -y install fontconfig

  cd /usr/share/fonts

  mkdir chinese

  cd chinese   

  #上传拷贝出来的windows中文字

  chmod -R 755 /usr/share/fonts/chinese

3,安装ttmkfdir工具

  yum -y install ttmkfdir

  ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir

4,修改字体配置文件

  vim /etc/fonts/fonts.conf

5,保存退出,如果服务器可以重启的话,就reboot吧。

6,如果无法reboot,可以执行

  fc-cache

7,查看是否安装成功

  fc-list

  #看到刚上传的字体即为安装成功。

原文地址:https://www.cnblogs.com/fuhai0815/p/9713078.html