CentOS 6.X 安装中文字体

最近在做某医院项目,需要对服务器进行中文字体支持

方法一

直接把电脑上的ttf文件拉到/usr/share/fonts/lyx下,重启服务器即可
在这里插入图片描述

方法二:

  • 安装工具包
yum install -y fontconfig mkfontscale
  • 安装完成后,使用fc-list命令查看系统中已经安装的字体
[root@aniu-pd-api-2 ~]# fc-list
Utopia:style=Bold Italic
Nimbus Sans L:style=Regular Italic
Hershey\-Gothic\-English:style=Regular
URW Palladio L:style=Roman
Century Schoolbook L:style=Bold Italic
DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique
Nimbus Sans L:style=Bold
Utopia:style=Bold
Hershey\-Plain\-Duplex\-Italic:style=Regular
URW Chancery L:style=Medium Italic
DejaVu Sans:style=Bold Oblique
Nimbus Roman No9 L:style=Regular
Century Schoolbook L:style=Bold
Century Schoolbook L:style=Italic
Nimbus Sans L:style=Regular
Hershey\-Plain\-Duplex:style=Regular
URW Palladio L:style=Italic
Nimbus Sans L:style=Bold Condensed
URW Gothic L:style=Demi
Nimbus Roman No9 L:style=Medium Italic
Nimbus Mono L:style=Bold Oblique
Dingbats:style=Regular
Nimbus Roman No9 L:style=Medium
Nimbus Sans L:style=Bold Italic
DejaVu Sans:style=Oblique
Nimbus Mono L:style=Regular
Hershey\-Plain\-Triplex:style=Regular
Hershey\-Script\-Simplex:style=Regular
URW Gothic L:style=Book
DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold Oblique,Bold Oblique
Utopia:style=Italic
Hershey\-Plain\-Triplex\-Italic:style=Regular
DejaVu Sans,DejaVu Sans Light:style=ExtraLight
Nimbus Sans L:style=Regular Condensed Italic
URW Bookman L:style=Demi Bold
URW Bookman L:style=Light
Hershey\-Script\-Complex:style=Regular
URW Gothic L:style=Demi Oblique
Standard Symbols L:style=Regular
DejaVu Sans,DejaVu Sans Condensed:style=Condensed,Book
DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
URW Palladio L:style=Bold
Nimbus Sans L:style=Regular Condensed
URW Bookman L:style=Light Italic
Century Schoolbook L:style=Roman
Nimbus Roman No9 L:style=Regular Italic
DejaVu Sans:style=Bold
DejaVu Sans:style=Book
Hershey\-Gothic\-Italian:style=Regular
URW Gothic L:style=Book Oblique
URW Palladio L:style=Bold Italic
Nimbus Mono L:style=Regular Oblique
Utopia:style=Regular
Nimbus Mono L:style=Bold
Hershey\-Gothic\-German:style=Regular
Nimbus Sans L:style=Bold Condensed Italic
URW Bookman L:style=Demi Bold Italic
  • 查看系统中已经安装的中文字体
fc-list :lang=zh # 没安装中文字体前,笔者的系统没有任何中文字体支持
  • 安装字体
    用户可以根据需要的字体进行针对性安装,笔者这里打包了win10下所有的字体,上传到服务器上进行安装
unzip win-fonts.zip -d /usr/share/fonts/
cd /usr/share/fonts/
mkfontscale
mkfontdir
fc-cache
[root@aniu-pd-api-1 fonts]# fc-list :lang=zh
发布了52 篇原创文章 · 获赞 84 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_39380155/article/details/104462384