linux添加中文字体

1、linux查看系统字体命令:fc-list

root@c6e06f09edff:/usr/local/tomcat# fc-list
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book

 图中所示没有中文字体

如果遇到commond not fond需要安装fontconfig

ubuntu安装命令:apt-get install fontconfig

centos安装命令:yum install fontconfig

2、安装字体

linux默认没有中文字体,可以将win10系统中字体文件拷过去使用

win10字体文件夹:C:\windows\Fonts

linux字体文件夹:/usr/share/fonts/

1.在linux字体文件夹/usr/share/fonts/中新建一个名叫win_ch_fonts的文件夹,将字体文件放进去

2.刷新字体缓存:

fc-cache

3.再次查看字体:

[root@iZ251fpy8x9Z sfeuser01]# fc-list
/usr/share/fonts/win_ch_fonts/STXINWEI.TTF: STXinwei:style=Regular
/usr/share/fonts/win_ch_fonts/STXIHEI.TTF: STXihei:style=Regular
/usr/share/fonts/win_ch_fonts/msyh.ttc: Microsoft YaHei:style=Normal
/usr/share/fonts/win_ch_fonts/FZLTCXHJW.TTF: FZLanTingHeiS\-UL\-GB:style=Regular
/usr/share/fonts/dejavu/DejaVuSansCondensed-Oblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique
/usr/share/fonts/win_ch_fonts/msyhl.ttc: Microsoft YaHei UI,Microsoft YaHei UI Light:style=Light,Regular
/usr/share/fonts/win_ch_fonts/STFANGSO.TTF: STFangsong:style=Regular
/usr/share/fonts/win_ch_fonts/STKAITI.TTF: STKaiti:style=Regular
/usr/share/fonts/dejavu/DejaVuSansCondensed-Bold.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
/usr/share/fonts/win_ch_fonts/SIMLI.TTF: LiSu:style=Regular
/usr/share/fonts/win_ch_fonts/STHUPO.TTF: STHupo:style=Regular
/usr/share/fonts/win_ch_fonts/SIMYOU.TTF: YouYuan:style=Regular

成功

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值