MagickWand, DrawSetFont does nothing, always Arial

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply

MagickWand, DrawSetFont does nothing, always Arial

Post by monsters »


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();
DrawSetFont ( $drawing , "Times" ) ;
DrawSetFontSize( $drawing,$fontsize);
MagickSetFormat($source, 'JPEG');
DrawAnnotation($drawing, $xLocation, $yLocation + $height , $string);
MagickDrawImage($source, $drawing);

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
User avatar
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post 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.

Post by monsters »


I tried using

set MAGICK_DEBUG annotate


export MAGICK_DEBUG=annotate

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

Thanks for your reply


Post 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.
Post Reply