当前linux服务器系统版本为centos7.6
首先找到windows系统存放字体的文件夹:
C:\Windows\Fonts
![image.png](https://img-blog.csdnimg.cn/img_convert/459a666ef000f90b4cf8556a7330a3b4.png#averageHue=#f4f3f2&clientId=u05df3c1a-ec87-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=721&id=u30bfb36a&margin=[object Object]&name=image.png&originHeight=721&originWidth=1077&originalType=binary&ratio=1&rotation=0&showTitle=false&size=159400&status=done&style=none&taskId=u4716064a-ab60-4a69-b10e-a024ccf8428&title=&width=1077)
把这些字体打成一个压缩包,然后使用Xftp上传到linux服务器上
输入命令,查看linux系统的
fc-list
![image.png](https://img-blog.csdnimg.cn/img_convert/82052e2ccfb5a56b92b03439603faa99.png#averageHue=#120f0c&clientId=u05df3c1a-ec87-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=266&id=ud190f3e4&margin=[object Object]&name=image.png&originHeight=266&originWidth=935&originalType=binary&ratio=1&rotation=0&showTitle=false&size=28869&status=done&style=none&taskId=ue9b1189f-457a-4a5f-9a94-039f052dc49&title=&width=935)
可以看到,目前仅有这几种默认字体。
在linux系统上创建存放字体的文件夹
cd /usr/share/fonts
mkdir -p myFonts
把压缩好的字体放到新创建的文件夹里并解压
![image.png](https://img-blog.csdnimg.cn/img_convert/50c59eb3ea80de09a0e649fcfac96c4f.png#averageHue=#0d0a08&clientId=u05df3c1a-ec87-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=422&id=u9850cf89&margin=[object Object]&name=image.png&originHeight=422&originWidth=884&originalType=binary&ratio=1&rotation=0&showTitle=false&size=44115&status=done&style=none&taskId=u6589c41b-5d93-42a4-a673-f4ddf162f6f&title=&width=884)
安装字体索引指令
yum install mkfontscale
进入字体目录,刷新字体索引缓存
mkfontscale && mkfontdir && fc-cache -fv
![image.png](https://img-blog.csdnimg.cn/img_convert/01d826c7b0f3754fac0d4c4924d62139.png#averageHue=#0c0907&clientId=u05df3c1a-ec87-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=376&id=uf514a90d&margin=[object Object]&name=image.png&originHeight=376&originWidth=860&originalType=binary&ratio=1&rotation=0&showTitle=false&size=32432&status=done&style=none&taskId=u3ed1802e-9cb7-4aff-9f08-6c0b16208b3&title=&width=860)
再次查看linux服务器字体
fc-list
![image.png](https://img-blog.csdnimg.cn/img_convert/b03c604201d6f191c25b322269e4b739.png#averageHue=#110d0b&clientId=u05df3c1a-ec87-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=513&id=ub53304e1&margin=[object Object]&name=image.png&originHeight=513&originWidth=903&originalType=binary&ratio=1&rotation=0&showTitle=false&size=56220&status=done&style=none&taskId=ud7113bb2-5aee-48c4-ae9f-644f762d8f9&title=&width=903)