Reputation: 21
I am trying to write Tamil text on an image. I tried with different font files like latha.ttf and Uni Ila.Sundaram-01.ttf files. The problem is that the vowels are getting misplaced. Please see the image for reference. Can anyone please suggest to me how to overcome this issue?
I use the code below:
<?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);
?>
Upvotes: 2
Views: 318