1

Here is my php code for creating an image with text inside, I used Malayalam language text but PHP generating an image like this "?????"

<?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);
?>

the font ML_ttkarthika is avalable in unicode font website, please help me

feeela
  • 29,399
  • 7
  • 59
  • 71

1 Answers1

1

There are issues with ImageTTFText and Unicode.

You may want to look at this: PHP function imagettftext() and unicode

Community
  • 1
  • 1
LSerni
  • 55,617
  • 10
  • 65
  • 107