centos6和centos7无网络环境下安装fontconfig,配置中文字体

以centos6为例

1、查看系统版本

cat /etc/redhat-release

2、访问https://vault.centos.org下载相关rpm包

找到对应系统版本

3、下载相应的rpm包上传到服务器

dejavu-fonts-common-2.33-1.el6.noarch.rpm

dejavu-sans-fonts-2.33-1.el6.noarch.rpm

fontconfig-2.8.0-5.el6.x86_64.rpm

fontpackages-filesystem-1.41-1.1.el6.noarch.rpm

freetype-2.3.11-17.el6.x86_64.rpm

4、进入rpm包文件夹

rpm -Uvh --force --nodeps *.rpm

5、查看linux已安装中文字体

fc-list :lang=zh

6、上传字体

mkdir -p /usr/share/fonts/my_fonts

将要安装的字体上传到该文件夹下

进入C:\Windows\Fonts,该文件夹下就存放相关字体

7、添加字体文件

vim /etc/fonts/fonts.conf

<!-- Font directory list -->

<dir>/usr/share/fonts</dir>

<dir>/usr/share/fonts/my_fonts</dir>

<dir>/usr/share/X11/fonts/Type1</dir> <dir>/usr/share/X11/fonts/TTF</dir> <dir>/usr/local/share/fonts</dir>

<dir prefix="xdg">fonts</dir>

<!-- the following element will be removed in the future →

8、刷新内存中的字体缓存

fc-cache

5、查看字体列表fc-list

fc-list :lang=zh

相关推荐
码农101号12 分钟前
运维安全05 - iptables规则保存与恢复
运维·网络·安全
Empty_77715 分钟前
SELinux安全上下文
linux·服务器·安全
bug攻城狮1 小时前
解决Ubuntu中apt-get -y安装时弹出交互提示的问题
linux·运维·ubuntu
xiachong271 小时前
ubuntu18.04安装PCL1.14
linux·ubuntu
夜阑珊夭夭2 小时前
linux自定义网卡名字
linux·运维
czhc11400756632 小时前
Linux912 shell:$# $1 $?;RHEL 8 AppStream BaseOS
linux
佛天华2 小时前
centos 时间校准
linux·运维·centos
小柯J桑_3 小时前
Linux:线程封装
linux·运维·c++
先锋队长3 小时前
linux系统搭建nacos集群,并通过nginx实现负载均衡
linux·nginx·负载均衡