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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 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安装部署