centos 7 添加windows 字体

环境:

centos 7

mono 5.2  Asp.net MVC5

问题:

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

 

解决:

到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

 

posted @ 2017-08-30 16:46  hobinly  阅读(4945)  评论(0编辑  收藏  举报