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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章