The subject:   convert: unable to read font `Helvetica'.

The command:

  convert -size 150x100 -font Helvetica -pointsize 48 -background yellow \
             -fill white -gravity center 'label:A'  text1.png

The platform:   Windows 2000



Once upon a time I installed ImageMagick v5.4.5. I hadn't used it in
quite a while but recently I started playing with it again. I received
the 'unable to read font' error.

I poked around a little and found the file type.mgk which selects the
files type-ghostscript.mgk and type-windows.mgk. The
type-ghostscript.mgk file referenced GhostScript font files in a
location on the C: drive where GhostScript has never been installed on
my machine. I edited the file type-ghostscript.mgk to correct the
pointers to the font files.

This resolved the problem using v5.4.5.

I decided to play around with the latest version of ImageMagick so I
downloaded v6.2.6.  Lo and behold, I have the same problem again: 'unable
to read font'. I discovered that the file names and locations of the
type.mgk files have changed slightly, but I found the type.xml and
corresponding type-ghostscript.xml files. (No type-windows.xml file
but not important.)

I noticed that the type-ghostscript.xml file contains references to
'@ghostscript_font_path@'. I tried setting an environment variable
called ghostscript_font_path pointing to my GhostScript font directory.
This didn't help. I tried setting GHOSTSCRIPT_FONT_PATH. This didn't
work either. I searched the registry looking for 'ghostscript_font_path'
hoping that this was something I could set there. No luck.

I finally edited the type-ghostscript file as I had done previously,
i.e. I changed all the occurrences of '@ghostscript_font_path@' to my
GhostScript directory name. This did not solve my problem. I was still
getting 'unable to read font'.

I pulled down the ImageMagick source to see if I could figure out where
ImageMagick is expecting to find the GhostScript fonts. Well, it's
looking in the Registry for specific installations of GhostScript. This
is well and good but I HAVE a copy of GhostScript on my machine. It's
just not registered in the Regsitry. (The reason why is another story.)
It would be nice if there was an environment variable, or something,
that I could set pointing ImageMagick to my GhostScript installation.

In any case, correcting the font file paths in type-ghostscript.xml
should have solved the problem. But it didn't.

I was about to manually start adding stuff to the Registry when I
decided to try one last thing. I removed the type.xml file and renamed
the type-ghostscript.xml to type.xml. (In essence, I copied the contents
of the corrected type-ghostscript.xml over top of type.xml.) This solved
the problem.


So, ImageMagick v6.2.6 appears to have a problem processing the 'include'
element in the type.xml file.


Cordially,

steve






_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to