View Issue Details

IDProjectCategoryView StatusLast Update
0003655mantisbtreportspublic2016-07-09 19:28
ReporterNetCobra Assigned Tovboctor  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionduplicate 
Summary0003655: Graph display wrong chinese word
Description

I'm using mantis in Windows2000 Server Simplified Chinese SP4 + IIS5,and I set $g_default_language = 'chinese_simplified';when I use graph I found that all chinese word in graph display wrong code.when I set $g_default_language = 'english'; it display right,but it's english word :-(

My mantis version is 0.18.2 and jpgraph version is 1.14,mantis was installed on Windows2000 Server Simplified Chinese SP4 + IIS5,My browser is IE6.

Additional Information

I had found what's happened,jpgraph support Chinese now,but it need SetFont() when using Chinese.So I add some code in \core\graph_api.php:

to pie charts:

//Set the title font if the default_language is set to chinese
if (config_get('default_language') == 'chinese_simplified'){
$graph->title->SetFont(FF_SIMSUN,FS_NORMAL);
$graph->legend->SetFont(FF_SIMSUN,FS_NORMAL);
}
else if (config_get('default_language') == 'chinese_traditional'){
$graph->title->SetFont(FF_CHINESE,FS_NORMAL);
$graph->legend->SetFont(FF_CHINESE,FS_NORMAL);
};

to other charts:

//Set the title font if the default_language is set to chinese
if (config_get('default_language') == 'chinese_simplified'){
$graph->title->SetFont(FF_SIMSUN,FS_NORMAL);
$graph->xaxis->title->SetFont(FF_SIMSUN,FS_NORMAL);
$graph->yaxis->title->SetFont(FF_SIMSUN,FS_NORMAL);
$graph->xaxis->SetFont(FF_SIMSUN,FS_NORMAL);
$graph->yaxis->SetFont(FF_SIMSUN,FS_NORMAL);
}
else if (config_get('default_language') == 'chinese_traditional'){
$graph->title->SetFont(FF_CHINESE,FS_NORMAL);
$graph->yaxis->title->SetFont(FF_CHINESE,FS_NORMAL);
$graph->xaxis->title->SetFont(FF_CHINESE,FS_NORMAL);
$graph->xaxis->SetFont(FF_CHINESE,FS_NORMAL);
$graph->yaxis->SetFont(FF_CHINESE,FS_NORMAL);
};

now it works fine.

The Uploaded File is a CVS patch file for graph_api.php,maybe it can help you.

Tagspatch
Attached Files

Relationships

duplicate of 0007937 closedatrol Special characters not correctly displayed in graphs 
has duplicate 0006281 closedgrangeway [zh_TW] Please add simsun font support for JPGraph in graph_api.php 

Activities

epu

epu

2004-05-12 19:38

reporter   ~0005493

User has included a patch.
Please review patch and fix for Simplified Chinese users.

Quentin

Quentin

2006-09-16 00:30

reporter   ~0013398

Last edited: 2006-09-16 00:37

This is the same modification I done in my copy...fix both traditional simplified chinese
but until version 1.0.5 this is still not implemented!!

additional code needed in graph_api.php, around line 35 in function graph_get_font()
add in
'chinese_traditional' => FF_CHINESE,
'chinese_simplified' => FF_SIMSUN,

Quentin

Quentin

2006-09-16 00:33

reporter   ~0013399

Reminder sent to: epu, vboctor

about chinese font display jpgraph error

NetCobra

NetCobra

2006-09-16 22:05

reporter   ~0013404

Last edited: 2006-09-17 01:13

To Quentin:
I add a new bug about this bug( http://www.mantisbugtracker.com/bugs/view.php?id=6281 ),but there is no response :-(

josef53

josef53

2007-04-21 11:41

reporter   ~0014381

Hi, it seems that a similar prblem exsits for german umlaute. I use 1.1.0a2.