CentOS 7安装字体

安装fontconfig

# 安装 fontconfig
yum -y install fontconfig

执行完该指令后就可以看到/usr/share/fonts/usr/share/fontconfig目录。

导入字体

# 创建目录
cd /usr/share/fonts
mkdir /usr/share/fonts/chinese
# 修改目录权限
chmod -R 755 /usr/share/fonts/chinese

# 复制字体库到chinese目录
# cp ... ...

# 建立字体缓存
yum -y install mkfontscale
mkfontscale
mkfontdir

# 刷新内存中的字体缓存
fc-cache –fv
# 执行以下命令让字体生效
source /etc/profile

# 查看系统安装字体
fc-list
fc-list :lang=zh

卸载字体

# 删除对应的字体
rm /usr/share/fonts/chinese/xx字体

# 刷新内存中的字体缓存
fc-cache –fv
# 执行以下命令让字体生效
source /etc/profile

你可能感兴趣的:(CentOS 7安装字体)