Page 1 of 1

Automatically resize caption font size

Posted: 2011-05-17T21:39:36-07:00
by qaz123
Is there a way to keep the caption formatting (ie. kerning, interline-spacing) as well as the page size (ie.500x400) but allow the font to automatically resize so that word wrap does not cut off the text at the bottom?

Also, is it possible to set a certain pointsize if no overflow happens and allow automatic pointsize adjustments when the texts do not fit in the image?

Thanks!

Re: Automatically resize caption font size

Posted: 2011-05-18T18:05:38-07:00
by anthony
Yes specify the height as well as the normal width of the caption.
Without a pointsize being set (use +pointsize to unset if you already set it previously) caption (like lables) will resize.

See IM examples, Text to Image, Caption, Best Fit Caption
http://www.imagemagick.org/Usage//text/#caption_bestfit

NOTE: label and caption resize is slower as internally IM does a trial and error match to find a pointsize that fits (according to the font information).

PS: currently gravity is used for justification! I hope to get gravity and justification separated in IMv7