Page 1 of 1

MagickWand: Font error

Posted: 2008-06-04T14:56:26-07:00
by Prince09
Hello,

I am trying to annotate some text on top of an image using the MagickWand (for C) API's. I am actually doing the following:

MagickWand *mwand;
DrawingWand *dwand;
MagickWandGenesis();
mwand = NewMagickWand();
char file[] = "image.jpg";
MagickReadImage(mwand, file);
dwand = NewDrawingWand();
MagickAnnotateImage(mwand, dwand, 10, 10, 0, "TEXT");


At this point, the program gives the following error::

unable to read font '/usr/local/lib/ImageMagick-6.4.1/config//usr/share/ghostscript/fonts/n019003l.pfb'.
'/usr/local/lib/ImageMagick-6.4.1/config//usr/share/ghostscript/fonts/n019003l.pfb'.

I'm guessing something is wrong with my ghostscript installation/configuration, but am not able to pin-point what is to be done. Any help will be appreciated.

Re: MagickWand: Font error

Posted: 2008-06-06T08:09:19-07:00
by Prince09
Ok. I found the answer - IM is unable to trace the path to the ghostscript fonts. IM needs to be reinstalled with the path to the GS fonts explicitly specified in the config. So, the following configure command (for Hardy Heron Ubuntu) solved it:

./configure --enable-shared=yes --disable-static –-without-perl --with-freetype –with-gs-font-dir=/usr/share/fonts/type1/gsfonts LDFLAGS=’-L/usr/local/lib –Wl,-rpath,/usr/local/lib’ > config.result