unable to find TrueType font Centos 5, ImageMagick 6.2.8

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
itpayz

unable to find TrueType font Centos 5, ImageMagick 6.2.8

Post by itpayz »

im getting unable to read font `/usr/share/fonts/default/TrueType/verdana.ttf'
when i'm installing a gem in ruby
gem install rmagick --local
where rmagick is
rmagick-1.15.12.gem

i did the following:
yum install ImageMagick*
yum install libjpeg-devel libpng-devel glib2-devel fontconfig-devel zlib-devel libwmf-devel freetype-devel libtiff-devel

I even created a symlink to the Type1 folder
[root@localhost default]# pwd ; ls
/usr/share/fonts/default
ghostscript Type1

In addition, i the following with no luck
[root@localhost default]# convert label:abcdef test.gif
convert: unable to read font `/usr/share/fonts/default/TrueType/arial.ttf'.
convert: missing an image filename `test.gif'.

Any ideas?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: unable to find TrueType font Centos 5, ImageMagick 6.2.8

Post by magick »

Looks like your version of ImageMagick requires that you have TrueType fonts installed, probably from another package. Either install this package and ensure the fonts can be found at /usr/share/fonts/default/TrueType or specify a font you know that is available. To determine the fonts, ImageMagick knows about, type
  • identify -list font
If that fails:
  • identify -list type
Now use it like this:
  • convert -font helvetica label:abcdef test.gif
itpayz

Re: unable to find TrueType font Centos 5, ImageMagick 6.2.8

Post by itpayz »

Thanks for the info

I manage to find this howto and it fixed the problem
http://corefonts.sourceforge.net
javismiles
Posts: 180
Joined: 2010-11-27T01:42:06-07:00
Authentication code: 8675308

Re: unable to find TrueType font Centos 5, ImageMagick 6.2.8

Post by javismiles »

i think i found those files in
/usr/local/lib/ImageMagick-6.6.8/config

now, i can see different ones, these ones:
type-dejavu.xml type-windows.xml
type-ghostscript.xml type.xml

in which ones do i have to add my ten fonts?
in type-windows.xml? or type-ghostscript.xml?

once i add them they will be recognized by imagemagick then?

how do i add them?
thank u so much :)
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: unable to find TrueType font Centos 5, ImageMagick 6.2.8

Post by anthony »

The best place to list your personal fonts is in a personal "$HOME/.magick/type.xml" file.

However that is for your personal use on the command line. IT would not be seen in PHP.

For PHP use "image_type_gen" script to create a new file "type-myfonts.xml" or something like that

Now edit the "type.xml" file and create a include for that new file, just like there are existing includes for the other files. NOTE the order is important. The last font match is the font that will be used. You can see the order of includes using

Code: Select all

convert -type font | grep Path:
This way you can update your "type-myfonts.xml" whenever you like without interfering with the other existing type files.

I myself do this with my personal "$HOME/.magick/type.xml" file too. allowing me to update specific sets of font configurations as I add or update them and or my system.

PS: if you put it in the system area, and not in a personal area, watch out for upgrades and re-inastalls of ImageMagick. I myself keep a log of all non-home changes to any computer I look after. That way I can quickly look them up and re-apply any changes again as need to. It is good system administration practise.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply