[thelist] primarilly for Martin Image Magick, width set by te xt string, a different approach

Roger Newbrook roger.newbrook at kmsoftware.com
Thu Feb 7 03:51:01 CST 2002


i asked my original question "does anyone know if it is possible to set the
width of an image in Image Magick by inputting a text string?" earlier this
week (before i posted to the list) to the Image Magick people, after a bit
of a delay they replied and thought i'd share their response with you...

"Questions about IM should be posted to magick-users at imagemagick.org,
however,
we just happen to have worked on your problem recently so I'll answer.  Get
ImageMagick-5.4.3 from ftp://ftp.imagemagick.org/pub/ImageMagick/beta.
Don't
let the beta fool you-- it's a production release just waiting for the
release
date of Feb 15th.


With 5.4.3 you can use the label delegate and give it a pre-defined image
width and it will pick a pointsize to fill the width:

  convert -size 640x0 -font Ariall.ttf label:'I am a Title' image.png

or you can pick a pointsize and it will generate the correctly sized image
centered:

  convert -pointsize 48 -font Ariall.ttf label:'I am a Title' image.png

for finer control use AnnotateImage() either from the C, C++, or PerlMagick
API's.

Make sure you build with the Freetype delegate otherwise Ghostscript is used
to do the rendering and the fonts will look rather amateurish."


thought you might find this useful

roger



More information about the thelist mailing list