linux中文字体设置

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

原文地址:https://www.cnblogs.com/yesyes/p/15375416.html