web2project Gantt 中文亂碼修正
1. copy arialuni.ttf to web2project/lib/fonts/
2. edit lib/jpgraph/src/jpg-config.inc
//define('BASE_FONT', 'FreeSans');
//define('CUSTOM_TTF_FONT', BASE_FONT . '.ttf');
//define('CUSTOM_TTF_FONT_BOLD', BASE_FONT.'Bold.ttf');
//define('CUSTOM_TTF_FONT_ITALIC', BASE_FONT.'Oblique.ttf');
//define('CUSTOM_TTF_FONT_BOLDITALIC', BASE_FONT.'BoldOblique.ttf');
//DEFINE('CHINESE_TTF_FONT','bkai00mp.ttf');
define('BASE_FONT', 'arialuni');
define('CUSTOM_TTF_FONT', BASE_FONT . '.ttf');
define('CUSTOM_TTF_FONT_BOLD', BASE_FONT . '.ttf');
define('CUSTOM_TTF_FONT_ITALIC', BASE_FONT . '.ttf');
define('CUSTOM_TTF_FONT_BOLDITALIC', BASE_FONT . '.ttf');
DEFINE('CHINESE_TTF_FONT','arialuni.ttf');
3. edit lib/jpgraph/src/jpgraph.php
elseif( $aFF === FF_CHINESE ) {
if( !function_exists('iconv') ) {
JpGraphError::RaiseL(25006);
//('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).');
}
// return iconv('BIG5','UTF-8',$aTxt);
return $aTxt;
}
4. edit modules/projectdesigner/gantt.php
$name = $a['task_name'];
if ($locale_char_set == 'utf-8') {
//$name = utf8_decode($name);
}
5. edit modules/projects/gantt.php
if ($locale_char_set == 'utf-8') {
// $name = strlen(utf8_decode($p['project_name'])) > 25 ? substr(utf8_decode($p['project_name']), 0, 22) . '...' : utf8_decode($p['project_name']);
$name = strlen($p['project_name']) > 25 ? substr($p['project_name'], 0, 22) . '...' : $p['project_name'];
} else {
//while using charset different than UTF-8 we need not to use utf8_decode
$name = strlen($p['project_name']) > 25 ? substr($p['project_name'], 0, 22) . '...' : $p['project_name'];
}
6. edit modules/projects/vw_sub_projects_gantt.php
if ($locale_char_set == 'utf-8') {
// $name = strlen(utf8_decode($p['project_name'])) > 25 ? substr(utf8_decode($p['project_name']), 0, 22) . '...' : utf8_decode($p['project_name']);
$name = strlen($p['project_name']) > 25 ? substr($p['project_name'], 0, 22) : $p['project_name'];
} else {
//while using charset different than UTF-8 we need not to use utf8_deocde
$name = strlen($p['project_name']) > 25 ? substr($p['project_name'], 0, 22) : $p['project_name'];
}
7. edit modules/tasks/gantt.php
if ($locale_char_set == 'utf-8') {
// $name = utf8_decode($name);
}