Page 1 of 1

Making IM aware of a font

Posted: 2010-06-22T12:36:10-07:00
by zachrose
Hi. I'm on Ubuntu Lucid, and I just installed a font called Museo Sans. I can use the font in most applications (gEdit, for example) but I can't use it in ImageMagick. (It's an OpenType Font, should that make a difference.)

When I run convert -list font | grep "Muse*" I don't come up with anything. (When I grep for "Tim*" I get all the Times fonts.)

I found this Perl script: http://www.imagemagick.org/Usage/script ... k_type_gen from http://www.imagemagick.org/Usage/, and ran updatedb for good measure, but it didn't save any "type.xml" file to ~/.magick/, nor did it fix my issue.

Any ideas? Thanks for reading.

Re: Making IM aware of a font

Posted: 2010-06-22T14:56:41-07:00
by fmw42
I believe that you can run it as

imagemagick_type_gen > type.xml

Then move that file to /usr/local/bin or where ever you have IM compiled

Do a search, such as

find /usr | grep "type.xml"

or

find /usr | grep "convert"

or

which convert

to see where it should be placed

Then run

convert -list type

and it should be there with all the other fonts.. Not too sure about OpenType, but I think I recall Anthony telling me that should be OK.

Alternately, just put the full path to your font in your -font command.

Re: Making IM aware of a font

Posted: 2010-06-22T21:26:30-07:00
by anthony
fmw42 wrote:I believe that you can run it as

imagemagick_type_gen > type.xml

Then move that file to /usr/local/bin or where ever you have IM compiled
Actually just copy that into a ".magick" sub-directory of your home. EG: $HOME/magick/type.xml

However you don't need to get ALL the system fonts I myself just grab the oft and ttf filenames in my personal fonts directory....

Code: Select all

        find $HOME/lib/fonts/ \( -name '*.ttf' -o -name '*.otf' \) |\
             imagick_type_gen -f - > ~/.magick/type-myfonts.xml
I then include this (and other type.xml files) into my personal type.xml file....

Code: Select all

<typemap>
   <include file="type-myfonts.xml" />
   <include file="type-system.xml" />
</typemap>
that way I can rebuild my personal fonts and have a separate one for specific systems.

But have putting it directly in the type.xml is fine too..