MagickWand: Font error

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
Prince09

MagickWand: Font error

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

Re: MagickWand: Font error

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