centos7下安装中文字体

1.安装fontconfig
yum -y install fontconfig

 

2.创建chinesem目录
/usr/shared/fonts目录下新建一个目录chinese
#cd /usr/share/fonts
#mkdir chinese

 

3.上传如下两个文件到目录/usr/share/fonts/chinese
simhei.ttf
simsun.ttc
宋体和黑体

这两个文件在windows下的C:\Windows\fonts下可以找到

cp /tmp/simhei.ttf /usr/share/fonts/chinese/
cp /tmp/simsun.ttc /usr/share/fonts/chinese/

 

4.修改权限
#chmod -R 755 /usr/share/fonts/chinese

 

5.安装ttmkfdir
yum -y install ttmkfdir

 

6.执行如下命令
ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir

 

7.修改/etc/fonts/fonts.conf文件
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>/usr/share/fonts/chinese</dir>
        <dir prefix="xdg">fonts</dir>
        <!-- the following element will be removed in the future -->
        <dir>~/.fonts</dir>
复制代码

 

8.执行如下命令
#fc-cache

 

9.查看

复制代码
[root@hxl-hangzhou-db-backup001 fonts]# fc-list
/usr/share/fonts/dejavu/DejaVuSansCondensed-Oblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique
/usr/share/fonts/dejavu/DejaVuSansCondensed-Bold.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
/usr/share/fonts/chinese/simsun.ttc: SimSun,宋体:style=Regular,常规
/usr/share/fonts/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/chinese/simsun.ttc: NSimSun,新宋体:style=Regular,常规
/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/dejavu/DejaVuSansCondensed.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed,Book
/usr/share/fonts/dejavu/DejaVuSans-ExtraLight.ttf: DejaVu Sans,DejaVu Sans Light:style=ExtraLight
/usr/share/fonts/chinese/simhei.ttf: SimHei:style=Normal
/usr/share/fonts/dejavu/DejaVuSansCondensed-BoldOblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold Oblique,Bold Oblique
/usr/share/fonts/dejavu/DejaVuSans-Oblique.ttf: DejaVu Sans:style=Oblique
/usr/share/fonts/dejavu/DejaVuSans-BoldOblique.ttf: DejaVu Sans:style=Bold Oblique
复制代码

 

posted @   slnngk  阅读(1106)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2021-05-28 dataguard删除掉从库
2021-05-28 pdb管理
2021-05-28 MGMTDB管理
2020-05-28 cachecloud安装部署
点击右上角即可分享
微信分享提示