linux伺服器預設是沒有中文字型的,通過下面的方式可以安裝中文字型。
ubuntu系統:
# 安裝fontconfig xfonts-utils
sudo apt-get -y install fontconfig xfonts-utils
# 檢視是否已經支援中文自體
fc-list :lang=zh
# 下載下傳中文字型(如微軟雅黑)到 /usr/share/fonts/
# 清除緩存并安裝字型
cd /usr/share/fonts/
mkfontscale
mkfontdir
fc-cache
# 再次檢視字型是否安裝成功
fc-list :lang=zh
微軟雅黑:https://juxiang-1253978349.cos.ap-chengdu.myqcloud.com/static/微軟雅黑.ttf
GitHub: https://github.com/wmui