Page 1 of 1
Controlling line height...
Posted: 2008-05-27T01:20:56-07:00
by mattias
I use caption to generate word wrapped labels. Is there any way to control the lineheight of the text generated?
/mattias
Re: Controlling line height...
Posted: 2008-06-04T23:07:14-07:00
by anthony
That is called 'pointsize'. Sorry but that is actually what pointsize really means!
Re: Controlling line height...
Posted: 2008-06-05T00:29:55-07:00
by mattias
Yes - but if I would like it to be a value else then the standard for a given pointsize. Can that be done?
Re: Controlling line height...
Posted: 2008-06-05T16:34:20-07:00
by anthony
Not without further processing. I'm not certain if the freetype renderer actually has an option for 'line spacing', if it does christy may be happy to add a new setting option. If not well you will have to DIY
DIY can come in two forms...
- You can generate each line yourself and append or 'splice' in extra space at the top or bottom of each line. or position the lines on a larger virtual canvas (see IM examples "layers")
- Or you can use caption: to do all the word wrapping of the text, then use the IM examples script 'divide_vert' to split the image into a list of images and 'gaps'. You can then splice in extra space into the gap images, and append the image list together again.
Code: Select all
convert -size 200x -pointsize 20 caption:"This is a word wrapped line that is very very long" miff:- | divide_vert - miff:- | convert - -splice 0x2 -append expanded_caption.png
Other options to divide_vert is to junk the gap images, though I wouldn't do that as the 'gaps' can be variable.
ASIDE: this script was a proof of concept for a posible new option to IM to help split up and divide images into seperate parts based on either the input image, or that image and a mask showing the separate objects. Shame I have too many things to do, to implement it myself!
Re: Controlling line height...
Posted: 2008-06-05T23:57:04-07:00
by mattias
Ok - I understand. Thanks again.