centos 7 添加windows 字体

问题:

在生成验证码时报,验证码无法显示,字体集找不到

解决:

到windows 系统中,拷贝字体到centos中。

windows 字体集在“C:\Windows\Fonts”。

centos字体集在“/usr/share/fonts”

步骤:

1、mkdir /usr/share/fonts/windows

2、先从你本机 C:\Windows\Fonts 拷贝或者网络上下载你想要安装的字体文件(*.ttf文件)到/usr/share/fonts/windows目录下

3、修改字体文件的权限,使root用户以外的用户也可以使用

cd /usr/share/fonts/windows

chmod 755 *.ttf

3、建立字体缓存

mkfontscale (如果提示 mkfontscale: command not found,需自行安装 # yum install mkfontscale )

mkfontdir

fc-cache -fv (如果提示 fc-cache: command not found,则需要安装# yum install fontconfig )

4、重启计算机

reboot

本文作者: GavinDong

版权属于: GavinDong博客

文章链接: https://gavindong.com/2326.html

如果使用过程中遇到问题,可 **点击此处** 交流沟通。

版权所有,转载时必须以链接形式注明作者和原始出处及本声明。

(0)

发表回复

登录后才能评论