Linux安装中文字体_宋体

Linux安装中文字体_宋体


1.检查当前系统支持的字体

  • 检查已安装的字体,默认返回为空
fc-list 
  • 刷新字体库,默认返回系统已安装的字体
fc-cache -fv

2.安装字体

2.1.安装字体支持工具

yum -y install fontconfig

2.2.安装常用字体库

  • 使用以下命令安装常用字体
yum -y groupinstall fonts
  • 系统版本较高使用以下命令:
yum -y install group info fonts
  • 安装完成,检查可用的字体
[root@zsweb01 ~]#  fc-list                 
Tibetan Machine Uni:style=Regular
Liberation Mono:style=Regular
DejaVu Serif,DejaVu Serif Condensed:style=Condensed,Book
DejaVu Serif,DejaVu Serif Condensed:style=Condensed Bold Italic,Bold Italic
DejaVu Serif,DejaVu Serif Condensed:style=Condensed Bold,Bold
Liberation Sans:style=Regular
DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique
Lohit Punjabi:style=Regular
DejaVu Sans Mono:style=Bold Oblique
Carlito:style=Italic
Liberation Serif:style=Bold Italic
Caladea:style=Bold
DejaVu Serif:style=Bold Italic
Lohit Oriya:style=Regular
Caladea:style=Bold Italic,Italic
UnDotum,은 돋움:style=Regular
STIXGeneral:style=Bold
DejaVu Sans:style=Bold Oblique
AR PL UMing TW:style=Light
Padauk:style=Bold
Khmer OS:style=Regular
AR PL UMing HK:style=Light
PakTypeNaqsh:style=Regular
STIXGeneral:style=Italic
AR PL UMing CN:style=Light
Meera:style=Regular
Carlito:style=Regular
Liberation Serif:style=Bold
STIXGeneral:style=Regular
Liberation Mono:style=Bold Italic
Waree:style=Oblique
STIXGeneral:style=Bold Italic
DejaVu Sans:style=Oblique
Lohit Kannada:style=Regular
Khmer OS System:style=Regular
PakTypeTehreer:style=Regular
Unikurd Web:style=Regular
Lohit Assamese:style=Regular
Liberation Sans:style=Bold
DejaVu Sans Mono:style=Oblique
Lohit Devanagari:style=Regular
Carlito:style=Bold Italic
DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold Oblique,Bold Oblique
Waree:style=BoldOblique
Caladea:style=Italic
Carlito:style=Bold
Khmer OS Content:style=Regular
Liberation Serif:style=Regular
DejaVu Sans,DejaVu Sans Light:style=ExtraLight
Liberation Sans:style=Bold Italic
WenQuanYi Zen Hei,文泉驛正黑,文泉驿正黑:style=Regular
DejaVu Sans,DejaVu Sans Condensed:style=Condensed,Book
DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
Liberation Mono:style=Bold
Padauk:style=Regular
Abyssinica SIL:style=Regular
Jomolhari:style=Regular
DejaVu Serif,DejaVu Serif Condensed:style=Condensed Italic,Italic
Caladea:style=Regular
Madan:style=Regular
Lohit Tamil:style=Regular
DejaVu Sans:style=Bold
DejaVu Sans:style=Book
DejaVu Serif:style=Italic
UnDotum,은 돋움:style=Bold
WenQuanYi Zen Hei Mono,文泉驛等寬正黑,文泉驿等宽正黑:style=Regular
LKLUG:style=Regular
Lohit Gujarati:style=Regular
DejaVu Sans Mono:style=Book
DejaVu Sans Mono:style=Bold
Liberation Serif:style=Italic
Lohit Bengali:style=Regular
Liberation Mono:style=Italic
AR PL UMing TW MBE:style=Light
Waree:style=Book
WenQuanYi Zen Hei Sharp,文泉驛點陣正黑,文泉驿点阵正黑:style=Regular
Waree:style=Bold
Liberation Sans:style=Italic
VL Gothic,VL ゴシック:style=regular
DejaVu Serif:style=Book
Lohit Telugu:style=Regular
DejaVu Serif:style=Bold

2.3.刷新字体库

  • 安装完成后,手动刷新下
[root@zsweb01 ~]# fc-cache -fv             
/usr/share/fonts: caching, new cache contents: 0 fonts, 29 dirs
/usr/share/fonts/abyssinica: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/cjkuni-uming: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/dejavu: caching, new cache contents: 21 fonts, 0 dirs
/usr/share/fonts/google-crosextra-caladea: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/google-crosextra-carlito: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/jomolhari: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/khmeros: caching, new cache contents: 3 fonts, 0 dirs
/usr/share/fonts/kurdit-unikurd-web: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/liberation: caching, new cache contents: 12 fonts, 0 dirs
/usr/share/fonts/lklug: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-assamese: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-bengali: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-devanagari: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-gujarati: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-kannada: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-oriya: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-punjabi: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-tamil: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-telugu: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/madan: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/paktype: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/sil-padauk: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/smc: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/stix: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/thai-scalable: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/tibetan-machine-uni: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/un-core: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/vlgothic: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/wqy-zenhei: caching, new cache contents: 3 fonts, 0 dirs
/usr/share/X11/fonts/Type1: skipping, no such directory
/usr/share/X11/fonts/TTF: skipping, no such directory
/usr/local/share/fonts: skipping, no such directory
/root/.fonts: skipping, no such directory
/var/cache/fontconfig: cleaning cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded

2.4.安装仿宋字体

  • 下载对应的字体文件,Windows 可以到系统里搜索,仿宋字体名称:simfang.ttf

  • 创建字体目录,上传指定字体

cd /usr/share/fonts
mkdir -p mswfonts
cd mswfonts
rz -y
  • 刷新系统字体库
fc-cache -fv
fc-list 
  • 或者使用
fc-list :lang=zh-cn
  • 在linux,把字体文件拷贝到字体目录后,执行fc-cache命令,fc-cache扫描字体目录并生成字体信息的缓存,然后应用程序就可以立即使用这些新安装的字体。

3.参考文章:

https://www.cnblogs.com/Azi-mi/p/9955743.html

https://www.cnblogs.com/maybo/p/5182492.html

posted @ 2023-05-26 10:34  天生帅才  阅读(3125)  评论(0编辑  收藏  举报
// 百度统计