Page 1 of 1

MagickWand, DrawSetFont does nothing, always Arial

Posted: 2006-11-20T14:24:58-07:00
by monsters
Hi,

I have a succesfful imagemagic/ghostscript/magickwand install, and all is well, but no matter what font i specify, I get arial!

code sample , outputs the image, annotated properly, but only ever in arial...

-----
$source = NewMagickWand();
$drawing = NewDrawingWand();
$pixel = NewPixelWand();
PixelSetColor($pixel,"#ff0000");
DrawSetFillColor($drawing,$pixel);
DrawSetFont ( $drawing , "Times" ) ;
DrawSetFontSize( $drawing,$fontsize);
DrawSetFontWeight($drawing,100);
MagickReadImage($source,'3.jpg');
MagickSetFormat($source, 'JPEG');
DrawAnnotation($drawing, $xLocation, $yLocation + $height , $string);
MagickDrawImage($source, $drawing);
MagickWriteImage($source,'output.jpg');
----------

doing "identify -list type" shows lots of available fonts... also doing a command line ImageMagick command to create text works fine, and uses the requested font... eg:
--------------------------------------
echo "This is a test" | convert -background yellow -font Courier-New +antialias -page 200x200 text:- mediocreimage.jpg

Posted: 2006-11-20T15:25:55-07:00
by magick
Set this environment variable MAGICK_DEBUG as follows:

setenv MAGICK_DEBUG annotate

Run your PHP script and check the debugging output. It will tell you which font ImageMagick used to render your text.

Tried that, no difference.

Posted: 2006-11-20T15:36:13-07:00
by monsters
Hi,

I tried using

set MAGICK_DEBUG annotate

and

export MAGICK_DEBUG=annotate

at the shell, then running my php file
neither made it output anything different...

Thanks for your reply

upate

Posted: 2006-11-20T15:41:32-07:00
by monsters
i set magick_debug to all , and got lots of ouput, now i see that it's not reading the font!

i get 'unable to read font '/tmp/Courier-New' which is where i'm running it from, so that's good...

I used the full path to a ttf and it works a champ!!

thanks, magick_debug was the key.