中文乱码与字体库windows

设置中文后,查看图形有乱码,文字变成了方块


Win+R打开运行,输入fonts,回车进入Windows字体目录,找到微软雅黑-常规字体,复制出来将文件名修改为msyh.ttf,注意后缀ttf。

将msyh.ttf上传到服务器zabbix字体目录中:

/usr/share/zabbix/fonts/

修改配置文件

复制代码
查看字体配置# grep FONT_NAME /usr/share/zabbix/include/defines.inc.php  -n
45:define('ZBX_GRAPH_FONT_NAME',        'graphfont'); // font file name
93:define('ZBX_FONT_NAME', 'graphfont');
确认字体名称是否可以替换
# grep graphfont /usr/share/zabbix/include/defines.inc.php  -n
45:define('ZBX_GRAPH_FONT_NAME',        'graphfont'); // font file name
93:define('ZBX_FONT_NAME', 'graphfont');
执行快捷替换
# sed -i "s/graphfont/msyh/g" /usr/share/zabbix/include/defines.inc.php
确认是否替换成功
# grep FONT_NAME /usr/share/zabbix/include/defines.inc.php  -n
45:define('ZBX_GRAPH_FONT_NAME',        'msyh'); // font file name
93:define('ZBX_FONT_NAME', 'msyh');

猜你喜欢

转载自www.cnblogs.com/SZLLQ2000/p/9453151.html