[問題] 發文時的笑臉創造器中文亂碼
發表於 : 2006-10-02 18:22
PLUS 1.53
爬文搜尋笑臉創造器無解決方法....記得以前有的說!
不知道哪位大大知道解決方法的?
爬文搜尋笑臉創造器無解決方法....記得以前有的說!
不知道哪位大大知道解決方法的?
代碼: 選擇全部
$schriftdatei = 'arial';代碼: 選擇全部
$schriftdatei = 'mingliu.ttc';代碼: 選擇全部
if(!$text) $text = 'error';//$lang['SC_error'];代碼: 選擇全部
$text = iconv('Big5', 'UTF-8', $text);代碼: 選擇全部
$i = 0;
while($i < count($output)){
if(((!$gd_info['FreeType Support']) || (!file_exists($schriftdatei)))){
if($schattenfarbe) imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + 6), trim($output[$i]), $txt2color);
imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + 5), trim($output[$i]), $txtcolor);
}else{
if($schattenfarbe) imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + $schriftheight + 4), $txt2color, $schriftdatei, trim($output[$i]));
imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + $schriftheight + 3), $txtcolor, $schriftdatei, trim($output[$i]));
}
$i++;
}
代碼: 選擇全部
$i = 0;
while($i < count($output)){
if(((!$gd_info['FreeType Support']) || (!file_exists($schriftdatei)))){
if($schattenfarbe) imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + 6) + 2, trim($output[$i]), $txt2color);
imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + 5) + 2, trim($output[$i]), $txtcolor);
}else{
if($schattenfarbe) imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + $schriftheight + 4) + 2, $txt2color, $schriftdatei, trim($output[$i]));
imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + $schriftheight + 3) + 2, $txtcolor, $schriftdatei, trim($output[$i]));
}
$i++;
}
代碼: 選擇全部
$schriftdatei = 'arial';代碼: 選擇全部
$schriftdatei = 'mingliu.ttc';代碼: 選擇全部
$worte = split(" ", $text);
if(is_array($worte)){
$i = 0;
foreach($worte as $wort){
if((strlen($output[$i].' '.$wort) < 33) && (!substr_count($wort, '[SM'))){
$output[$i] .= ' '.$wort;
}else{
if($i <= 11){
if($zeichenzahl < strlen($output[$i])) $zeichenzahl = strlen($output[$i]);
$i++;
$output[$i] = $wort;
}
}
}
}else{
$zeichenzahl = 33;
$output[0] = substr($text, 0, 30)."...";
}
代碼: 選擇全部
// BEGIN -- kenspc modified
$worte = split(" ", $text);
$output[0] = '';
if(is_array($worte)){
$i = 0;
foreach($worte as $wort){
if((strlen($output[$i].' '.$wort) < 33) && (!substr_count($wort, '[SM'))){
$output[$i] .= ' '.$wort;
}else{
if($i <= 11){
if($zeichenzahl < strlen($output[$i])) $zeichenzahl = strlen($output[$i]);
if($output[$i] == ''){
$output[$i] = $wort;
}else{
$i++;
$output[$i] = $wort;
}
}
}
}
}else{
$zeichenzahl = 33;
$output[0] = substr($text, 0, 30)."...";
}
// END -- kenspc modified
代碼: 選擇全部
$width = ($zeichenzahl * $schriftwidth) + 6;
$height = (count($output) * $schriftheight) + 34;
代碼: 選擇全部
// BEGIN -- kenspc modified
//$width = ($zeichenzahl * $schriftwidth) + 6;
//$height = (count($output) * $schriftheight) + 34;
if(((!$gd_info['FreeType Support']) || (!file_exists($schriftdatei)))){
$width = ($zeichenzahl * $schriftwidth) + 6;
$height = (count($output) * $schriftheight) + 34;
}else{
$ttfbboxwidth = 0;
$i = 0;
while($i < count($output)){
$ttfbbox = imagettfbbox($schriftheight, 0, $schriftdatei, trim($output[$i]));
$tempwidth = $ttfbbox[4] - $ttfbbox[6];
if($ttfbboxwidth <= $tempwidth){
$ttfbboxwidth = $tempwidth;
}
$i++;
}
$width = $ttfbboxwidth + 6;
$ttfbboxheight = abs($ttfbbox[5] - $ttfbbox[3]);
$height = (count($output) * $ttfbboxheight) + 34;
}
// END -- kenspc modified
代碼: 選擇全部
$i = 0;
while($i < count($output)){
if(((!$gd_info['FreeType Support']) || (!file_exists($schriftdatei)))){
if($schattenfarbe) imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + 6), trim($output[$i]), $txt2color);
imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + 5), trim($output[$i]), $txtcolor);
}else{
if($schattenfarbe) imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + $schriftheight + 4), $txt2color, $schriftdatei, trim($output[$i]));
imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + $schriftheight + 3), $txtcolor, $schriftdatei, trim($output[$i]));
}
$i++;
}
代碼: 選擇全部
// BEGIN -- kenspc modified
$i = 0;
while($i < count($output)){
if(((!$gd_info['FreeType Support']) || (!file_exists($schriftdatei)))){
if($schattenfarbe) imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + 6) + 2, trim($output[$i]), $txt2color);
imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + 5) + 2, trim($output[$i]), $txtcolor);
}else{
if($schattenfarbe) imagettftext($img, $schriftheight, 0, (($width - $ttfbboxwidth - 2) / 2 + 1), ($i * $ttfbboxheight + $schriftheight + 4) + 4, $txt2color, $schriftdatei, trim($output[$i]));
imagettftext($img, $schriftheight, 0, (($width - $ttfbboxwidth - 2) / 2), ($i * $ttfbboxheight + $schriftheight + 3) + 4, $txtcolor, $schriftdatei, trim($output[$i]));
}
$i++;
}
// END -- kenspc modified