一. 為linux 安裝中文字體
1.安裝字體管理工具
yum install fontconfig mkfontscale -y
2.簡歷中文字體目錄
mkdir -p /usr/share/fonts/chinese
3.添加字體 到 chinese
並修改權限 chmod -R 755 /usr/share/fonts/chinese
並執行命令
ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir
4. 修改字體配置文件
修改字體配置文件了,首先通過編輯器打開配置文件
vim /etc/fonts/fonts.conf
可以看到一個Font list,即字體列表,在這里需要把我們添加的中文字體位置加進去:
4. 簡歷緩存字體,生成字庫索引信息
cd /usr/share/fonts/chinese
mkfontscale
mkfontdir
fc-cache
5. 查看字體
fc-list

6. 刷新 字體庫緩存 fc-cache -f -v (如果不存在, 安裝 命令: yum install -y fontconfig)
7.刷新緩存后 重啟項目