0

When I use this function to generate arabic text:

$img = new Imagick();
$img->setBackgroundColor(new ImagickPixel('white'));
$text = ' ولكن النا';
//Pango code for Hello World!
$img->newPseudoImage(200, 200, "pango:$text");
$img->writeImage("output.png");

The characters are "breaked"

enter image description here

Do you know why? Thanks

watb
  • 81
  • 6
  • I would suggest trying to get this to work with the ImageMagick command line tools first, to eliminate problem induced by the Imagick layer. Also you probably ought to set a font that definitely has those characters in it. – Danack Feb 08 '17 at 15:00
  • Because they are output as hex numbers in a "dump" format? These usually group values in blocks 4, 8 and 16 items. The real output shouldn't have those gaps. – Mike Feb 09 '17 at 09:44
  • @Mike The hex numbers are those of the characters/glyphs in the source string: http://www.fileformat.info/info/unicode/char/0627/index.htm http://www.fileformat.info/info/unicode/char/0646/index.htm http://www.fileformat.info/info/unicode/char/0644/index.htm That happens when the program understands the characters correctly, but doesn't have instructions of how to draw it in the font being used. The program isn't 'grouping' them. They are grouped in the source string. – Danack Feb 09 '17 at 15:30

1 Answers1

0

Finally, I found the solution! In fact, you have to install pangocairo lib.

When it's ok, you should see it with the "identify -version" command line: Version: ImageMagick 6.8.9-9 Q16 x86_64 2016-11-26 http://www.imagemagick.org Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC Features: DPC Modules OpenMP Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib

watb
  • 81
  • 6
  • could you please share your final code im having the same issue even though i have pangocairo installed – Khalil Awada Mar 07 '18 at 12:12
  • I am facing same problem. I have installed pangocairo but still same hex code square boxes ``` # identify -version Version: ImageMagick 6.9.10-68 Q16 x86_64 2020-04-01 https://imagemagick.org Copyright: © 1999-2019 ImageMagick Studio LLC License: https://imagemagick.org/script/license.php Features: Cipher DPC Modules OpenMP(3.1) Delegates (built-in): bzlib cairo fontconfig freetype gslib jng jpeg lcms ltdl lzma openexr pangocairo png ps rsvg tiff wmf x xml zlib ``` what do I need to restart the system? – Silkograph Jul 18 '20 at 09:16