1

这是我用于创建带有文本的图像的 php 代码,我使用了马拉雅拉姆语文本,但 PHP 生成了这样的图像“??????”

<?php mb_language('uni'); 
mb_internal_encoding('UTF-8'); 
header('Content-type: image/gif');
$text = 'മലയാളം  ';
$font = 'mlkarthika.ttf';
$im = imagecreatetruecolor(160, 160);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 159, 159, $white);
imagettftext($im, 12, 0, 20, 20, $black, $font, $text);
imagegif($im);
imagedestroy($im);
?>

字体 ML_ttkarthika 在 unicode 字体网站上可用,请帮助我

4

1 回答 1

1

ImageTTFText 和 Unicode 存在问题。

你可能想看看这个:PHP function imagettftext() and unicode

于 2012-09-17T10:48:06.683 回答