欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

CentOS 6.X 安装中文字体

程序员文章站 2022-03-21 11:06:13
...

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

方法一

直接把电脑上的ttf文件拉到/usr/share/fonts/lyx下,重启服务器即可
CentOS 6.X 安装中文字体

方法二:

  • 安装工具包
yum install -y fontconfig mkfontscale
  • 安装完成后,使用fc-list命令查看系统中已经安装的字体
[[email protected]-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
[[email protected] fonts]# fc-list :lang=zh