我正在尝试在图像上写泰米尔语文本。我尝试使用不同的字体文件,如 latha.ttf 和 Uni Ila.Sundaram-01.ttf 文件。问题是元音放错了位置。请参阅图片以供参考。谁能建议我如何克服这个问题?
我使用下面的代码:
<?php
header('Content-type: image/png; charset=UTF-8');
$text ='சுற்றிப்பார்க்க ';
$font = './fonts/UniIlla.ttf';
$im = imagecreatetruecolor(600, 300);
$bg_color = imagecolorallocate($im, 255, 255, 255);
$font_color = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 599, 299, $bg_color);
imagettftext($im, 20, 0, 10, 50, $font_color, $font, $font);
imagettftext($im, 20, 0, 10, 120, $font_color, $font, $text);
imagepng($im);
imagedestroy($im);
?>