Page 1 of 1

Annotate() not working for arabic text?

Posted: 2016-08-11T06:02:16-07:00
by bikash00789
Why arabic is coming question mark? I have tried lot of things nothing worked

Code: Select all

$final_image = new Imagick();
$final_image->newImage( 800, 420, new ImagickPixel('#ffffff'));
$final_image->setImageFormat('jpg');

$draw = new ImagickDraw();
$draw->setFillColor('#000');
$draw->setFont('AvantGarde-Demi');
$draw->setFontSize( 30 );

//Message1 is Hello my name is
$message1= "مرحبا اسمي";
$final_image->annotateImage( $draw, 40, 20, 0, "$message1");

$final_image->annotateImage( $draw, 40, 80, 0, "this text is in english");
Below is the output,
screencapture-cdn-meaww-com-answerspictures-one_word_personality-20160811-19505031470919935-17-jpg-1470920421391.png
screencapture-cdn-meaww-com-answerspictures-one_word_personality-20160811-19505031470919935-17-jpg-1470920421391.png (32.42 KiB) Viewed 12293 times

Re: Annotate() not working for arabic text?

Posted: 2016-08-11T08:41:58-07:00
by fmw42
The message1 text must be UTF-8 compatible. So the font and the tool that creates it both must be UTF-8 compliant