How can I use system font for annotation

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
bombona
Posts: 2
Joined: 2013-05-18T08:48:58-07:00
Authentication code: 6789

How can I use system font for annotation

Post by bombona »

Hi,

I use ImageMagick 6.7.9-8 2012-09-22 Q16 on Windows XP.
I wanted to annotate some images and use system font, like "Segoe UI", so command looks like:

Code: Select all

convert -background "#00000080" -fill white -font "Segoe UI" -pointsize 12 label:...
but it doesn't work as IM can't find the font.

Searching the net I was under impression that I need to make Fontmap file for Ghostscript and use GS_LIB environment variable to make the magic work:

I created "C:\Program Files\gs\gs9.07\lib\Fontmap" file with this content:

Code: Select all

/Segoe UI	(SEGOEUI.TTF);
and set GS_LIB to "C:\Windows\Fonts". However IM still can't find the font. ("C:\Program Files\gs\gs9.07\lib" is in my PATH variable FYI)

Any ideas?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How can I use system font for annotation

Post by fmw42 »

you either need to provide the full path to the font or run Anthony's script http://www.imagemagick.org/Usage/script ... k_type_gen to create a type.xml file for your fonts.
bombona
Posts: 2
Joined: 2013-05-18T08:48:58-07:00
Authentication code: 6789

Re: How can I use system font for annotation

Post by bombona »

Thanks for your fast reply :)

Full path works fine. That was enough

I tried also the Perl script under MinGW. Filepaths in XML dump were incorrect because of the way paths work under MinGW, i.e. "/c/windows/fonts" instead "c:/windows/fonts", but for some reason it also didn't detect my Segoe UI font, but just Segoe UI Light and Semibold, and extracted font names were not as they appear in common font dialogs... However as I have the structure of this XML file and explanation how to use it, I just re-created it with the help of 3rd part package.


Cheers
Post Reply