当前位置: 首页 > 工具软件 > JpGraph > 使用案例 >

jpgraph中文乱码

西门胜涝
2023-12-01
1.把字体文件( C:\WINDOWS/fonts/ )fonts复制到存放 jpgraph的相同文件下面。
2.在jpgraph.php里找到如下代码
// Setup path for western/latin TTF fonts
if (!defined('TTF_DIR')) {
if (strstr( PHP_OS, 'WIN') ) {
$sroot = getenv('SystemRoot');
if( empty($sroot) ) {
$t = new ErrMsgText();
$msg = $t->Get(12,$file,$lineno);
die($msg);
}
else {
define('TTF_DIR', $sroot.'/fonts/');
}
} else {
define('TTF_DIR','/usr/share/fonts/truetype/');
}
}
修改为:
// Setup path for western/latin TTF fonts
//
if (!defined('TTF_DIR')) {
if (strstr( PHP_OS, 'WIN') ) {
$sroot = getenv('SystemRoot');
if( empty($sroot) ) {
$t = new ErrMsgText();
$msg = $t->Get(12,$file,$lineno);
die($msg);
}
else {
define('TTF_DIR','jpgraph/fonts/');
}
} else {
define('TTF_DIR','/usr/share/fonts/truetype/');
}
}

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(C:\WINDOWS/fonts/simhei.ttf) is not within the allowed path(s): (e:/DedeAMPZ/WebRoot/hm5988comcn) in E:\DedeAMPZ\WebRoot\hm5988comcn\api\src\jpgraph\jpgraph_ttf.inc.php on line 497
JpGraph Error: 25049 Font file "C:\WINDOWS/fonts/simhei.ttf" is not readable or does not exist.


 类似资料: