前言
有時候我們有些服務需要作業系統支援中文,那怎麼安裝中文字體呢? Let's Go
安裝字型庫
# yum -y install fontconfig
這時在/usr/share目錄就可以看到fonts和fontconfig目錄了
配置字體庫目錄和拷貝字體檔案在/usr/share/fonts目錄下新建一個目錄chinese
# mkdir -p /usr/share/fonts/chinese
將下面的兩個字體上傳至/usr/share/fonts/chinese目錄下
# ls -lrt sim*-rw-r--r-- 1 root root 9753388 Apr 26 10:52 simhei.ttf-rw-r--r-- 1 root root 9076736 Apr 26 10: 52 simsun.ttc
賦予權限
# chmod -R 755 /usr/share/fonts/chinese
安裝ttmkfdir
安裝ttmkfdir來搜尋目錄中所有的字體訊息,並彙總產生fonts.scale文件
# mkdir -p /usr/share/X11/fonts/encodings
生效配置
1.沒有這個目錄的話,需要手工創建
# mkdir -p /usr/share/X11/fonts/encodings
2.編者增加<dir>/usr/share/fonts/chinese</dir>
# vi /etc/fonts/fonts.conf <dir>/usr/share/fonts</dir> <dir>/usr/share/X11/fonts/Type1</dir> < dir>/usr/share/X11/fonts/TTF</dir> <dir>/usr/local/share/fonts</dir> <dir>/usr/share/fonts/chinese</dir; <dir>/usr/share/fonts/chinese</dir> < dir>~/.fonts</dir>
3.生效
# fc-cache
驗證
可以看到宋體已經生效了
# fc-list :lang=zhNSimSun,新宋體:style=Regular,常規SimHei,黑體:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaanda,Normal,StandaЕ ,Normálne,Navadno,ArruntaSimSun,宋體:style=Regular,常規
說明
注意:有些字體在商業用途中,須在版權方授權範圍內使用,否則構成侵權。
文章為用戶上傳,僅供非商業瀏覽。發布者:Lomu,轉轉請註明出處: https://www.daogebangong.com/zh-Hant/articles/detail/Linux-ru-men-fu-wu-qi-an-zhuang-zhong-wen-zi-ti.html
评论列表(196条)
测试