>  기사  >  백엔드 개발  >  开源缺陷管理工具mantis中图形报表显示乱码

开源缺陷管理工具mantis中图形报表显示乱码

WBOY
WBOY원래의
2016-06-20 12:36:111229검색

只是改成中文之后,图形报表就显示乱码。有大神能帮忙解决下吗?用的是jpgraph


回复讨论(解决方案)

1、修改mant\plugins\MantisGraph\core\graph_api.php文件下
在56行找到
if ( plugin_config_get( 'eczlibrary' ) == ON ) {
              $t_font_map = array(
                        'arial' => 'arial.ttf',
                     'verdana' => 'verdana.ttf',
                     'trebuchet' => 'trebuc.ttf',
                     'verasans' => 'Vera.ttf',
                     'times' => 'times.ttf',
                     'georgia' => 'georgia.ttf',
                     'veraserif' => 'VeraSe.ttf',
                     'courier' => 'cour.ttf',
                     'veramono' => 'VeraMono.ttf',
              );
然后改成
if ( plugin_config_get( 'eczlibrary' ) == ON ) {
              $t_font_map = array(
'simsun' => 'SIMFANG.TTF',    //此处为添加处
                        'arial' => 'arial.ttf',
                     'verdana' => 'verdana.ttf',
                     'trebuchet' => 'trebuc.ttf',
                     'verasans' => 'Vera.ttf',
                     'times' => 'times.ttf',
                     'georgia' => 'georgia.ttf',
                     'veraserif' => 'VeraSe.ttf',
                     'courier' => 'cour.ttf',
                     'veramono' => 'VeraMono.ttf',
              );
在大约87行找到
e {
              $t_font_map = array(
                     'arial' => FF_ARIAL,
                     'verdana' => FF_VERDANA,
                     'trebuchet' => FF_TREBUCHE,
                     'verasans' => FF_VERA,
                     'times' => FF_TIMES,
                     'georgia' => FF_GEORGIA,
                     'veraserif' => FF_VERASERIF,
                     'courier' => FF_COURIER,
                     'veramono' => FF_VERAMONO,
              );
修改成:
else {
              $t_font_map = array(
     'simsun'=> FF_SIMSUN,           //此处为添加处
                     'arial' => FF_ARIAL,
                     'verdana' => FF_VERDANA,
                     'trebuchet' => FF_TREBUCHE,
                     'verasans' => FF_VERA,
                     'times' => FF_TIMES,
                     'georgia' => FF_GEORGIA,
                     'veraserif' => FF_VERASERIF,
                     'courier' => FF_COURIER,
                     'veramono' => FF_VERAMONO,
              );
然后保存,该文件修改完毕。
 
2、修改mant\plugins\MantisGraph\pages\config.php文件下
大约25行处找到
$t_current_font_selected = array(
       'arial' => false,
       'verdana' => false,
       'trebuchet' => false,
       'verasans' => false,
       'times' => false,
       'georgia' => false,
       'veraserif' => false,
       'courier' => false,
       'veramono' => false,
);
修改为
$t_current_font_selected = array(
       'simsun' => false,          //此处为添加处
       'arial' => false,
       'verdana' => false,
       'trebuchet' => false,
       'verasans' => false,
       'times' => false,
       'georgia' => false,
       'veraserif' => false,
       'courier' => false,
       'veramono' => false,
);

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.