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://www.cnblogs.com/huangyanqi/p/10609587.html
微軟雅黑:https://juxiang-1253978349.cos.ap-chengdu.myqcloud.com/static/微軟雅黑.ttf