Centos7系统添加Windows字体

开发利用OpenOffice组件转换PDF时,发现部分文字乱码,Linux系统本身就不自带Windows中文字体,故而将Windows中文字体导入至Linux。

# 1.安装字体库(已存在的跳过)
yum -y install fontconfig

# 2.新建存储中文字体的目录
mkdir /usr/share/fonts/chinese

# 3.利用FTP或其他工具将windows字体上传

# 4.安装ttmkfdir用于搜索目录中所有的字体信息并汇总生成fonts.scale文件
yum -y install ttmkfdir
ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir

# 5.添加中文字体路径
#vi /etc/fonts/fonts.conf
<!-- Font directory list -->
<dir>/usr/share/fonts/chinese</dir>

# 6.刷新缓存
fc-cache

# 7.验证
fc-list

 

posted @ 2020-09-09 16:03  MegaloBox  阅读(964)  评论(0编辑  收藏  举报