首页 > 其他 > 详细

CentOS7安装字体库

时间:2020-01-29 13:48:24      阅读:81      评论:0      收藏:0      [点我收藏+]

JAVA画图时常用到Font 类对象这样的对象依赖于本地的字段。新装的linux没有安装字段库,和相应的字体。

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目录下

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刷新

     运行sudo fc-cache -f -v命令刷新字体缓存

10、fc-list可以看到刚刚的配置了

CentOS7安装字体库

原文:https://www.cnblogs.com/zhyp/p/12240135.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!