Linux CentOS 7 安装 字体库文件(simsun.ttf、simheittf.ttf)

 

1、fc -list查看字体库

发现没有安装

2、yum -y install fontconfig安装

3、安装好后/usr/share目录下多两个目录fonts和fontconfig

4、首先在/usr/shared/fonts目录下新建一个目录chinese

5、到C:\Windows\Fonts目录下上传你需要的字体到/usr/shared/fonts/chinese目录下

本处需要上传的是simsun.ttf (宋体)、simheittf.ttf (黑体)

附下载链接:

https://download.csdn.net/download/weixin_41846320/10862472

6、修改chinese权限

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

7、接下来需要安装ttmkfdir来搜索目录中所有的字体信息,并汇总生成fonts.scale文件,输入命令:

yum -y install ttmkfdir

8、最后一步就是修改字体配置文件了,首先通过编辑器打开配置文件:

vi /etc/fonts/fonts.conf

 

<!-- Font directory list -->

        <dir>/usr/share/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>
        <dir>/usr/share/fonts/chinese</dir>
        <!-- the following element will be removed in the future -->
        <dir>~/.fonts</dir>

9、fc-cache 刷新

10、fc-list 可以看到刚刚已安装的字体了

  • 4
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值