zoukankan      html  css  js  c++  java
  • CentOS 7.6环境下安装中文字体库

    JAVA画图时常用到Font 类对象

    这样的对象依赖于本地的字段。新装的linux没有安装字段库,和相应的字体。

    1、fc-list查看字体库

    2、yum -y install fontconfig安装

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

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

    5、到C:WindowsFonts目录下上传你需要的字体到/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刷新

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

  • 相关阅读:
    信息安全系统设计基础第十二周学习总结
    day07-流程控制之while循环
    day07-深浅拷贝
    第一次小测
    day05-与用户交互与运算符
    day05学习笔记-垃圾回收机制
    day04学习笔记-变量
    day03-python-学习笔记
    P4323-[JSOI2016]独特的树叶【换根dp,树哈希】
    CF990G-GCD Counting【dfs】
  • 原文地址:https://www.cnblogs.com/aqicheng/p/10283520.html
Copyright © 2011-2022 走看看