研究jpgraph制作表格时发现这个问题,研究半天找到解决方发,亲测可用:
找到打开jpgraph_ttf.inc.php文件,搜索 define('CHINESE_TTF_FONT' 找到后字体改成SIMSUN.TTC
// Actual name of the TTF file used together with FF_CHINESE aka FF_BIG5
// This is the TTF file being used when the font family is specified as
// either FF_CHINESE or FF_BIG5
define('CHINESE_TTF_FONT','SIMSUN.TTC');
找到打开jpgraph_legend.inc.php文件,搜索 $font_family 找到代码后,改成如下样子
public $font_family=FF_SIMSUN,$font_style=FS_NORMAL,$font_size=8;
jpgraph调用页面 统计图的标题 前面加上代码:
$graph->title->SetFont(FF_SIMSUN);
完成!
如果还不行,在加上这个函数:
iconv("UTF-8","GB2312//IGNORE",'要转换的中文');