在CentOS中安装arial字体

验证码不能正常显示是因为 linux 没有字体

 

1. widonws下载字体文件到Linux

windows的字体比较多,其字体文件位于 C:\WINDOWS\Fonts 。 从其中copy相应的字体到Linux系统的 /usr/share/font/下的文件夹中。以arial字体为例:

# mkdir /usr/share/fonts/arial
# mv arial*.ttf /usr/share/fonts/arial/

2. 为刚加入的字体设置缓存使之有效

# cd /usr/share/fonts/arial
# mkfontscale #没有就安装yum install mkfontscale 
# mkfontdir
# fc-cache -fv #(如果提示 fc-cache: command not found,则需要安装# yum install fontconfig )

经过这样的设置后,即可在Gnome界面的 系统——首选项——外观——字体 中进行字体的选择了。

3. 设置gunplot对arial的选择路径

本文首页提示的错误是由于程序调用gunplot造成,必须让gunplot识别arial字体所在的路径才行。

$ export GDFONTPATH=/usr/share/fonts/arial
$ export GNUPLOT_DEFAULT_GDFONT="arial"
posted @ 2018-01-31 23:58  三瑞  阅读(1763)  评论(0编辑  收藏  举报