When I convert title to image site character broken.My language turkish(ISO-8859-9).Problem characters are ş-ı-ğ.The font is turkish.How am I solved this problem?
system_function_title.php
PHP Code:<?
header("Content-type: image/png");
header("Content-Disposition: inline; filename=" . $file);
header("Content-Type: text/xml; charset =ISO-8859-9");
// create the test to get width first ...
$test = imagecreate($image_width, $image_height);
$back = imagecolorallocate($test, $back_color[0] , $back_color[1] , $back_color[2] );
$front = imagecolorallocate($test, $front_color[0] , $front_color[1] , $front_color[2] );
$image_text = imagettftext($test, $font_size, 0, $position_left, $position_top, $front, $font_file, $text);
$image_width = $image_text[2] - $image_text[0] + 20;
imagedestroy($test);
// now this is the serious image ...
$im = imagecreate($image_width + 2 * $position_left, $image_height);
$back = imagecolorallocate($im, $back_color[0] , $back_color[1] , $back_color[2] );
$front = imagecolorallocate($im, $front_color[0] , $front_color[1] , $front_color[2] );
imagefilledrectangle($im, 0, 0, $image_width, $image_height, $back );
imagecolortransparent($im, $back);
$image_text = imagettftext($im, $font_size, 0, $position_left, $position_top, $front, $font_file, $text);
$image_width = $image_text[2] - $image_text[0];
imagepng($im);
imagedestroy($im);
?>
File
PHP Code:<?
include("setting.php");
$title = str_replace("\'", "'", $title);
$file = "$title.png";
$text = html_entity_decode($title, ENT_QUOTES);
$back_color = array(255, 255, 255); // (red, green, blue)
$front_color = array(193 , 0 , 0); // (red, green, blue)
$font_file = 'files/font/1.ttf';
$font_size = 18;
$image_width = (strlen($text)) * ($font_size - 1) + 20;
$image_height = 30;
$position_left = 0;
$position_top = 20;
include("system_function_title.php");
?>



Reply With Quote

Bookmarks