Page 1 of 1

Creating an image with multi line text

Posted: 2009-09-21T22:17:46-07:00
by BassTeQ
Hi all, I'm currently creating some text images using the code below, but Id like to be able to have multiple lines of text, if I put a "\n" in my text string it doesnt seem to honor it.
How can I do this?

Code: Select all

convert.exe -size 2000x300 xc:grey30 -font Arial -pointsize 79 -gravity center -draw "fill grey70  text 0,0'this is my test text'" stamp_fgnd79.png
convert.exe -size 2000x300 xc:black -font Arial -pointsize 79 -gravity center -draw "fill white  text  1,1  'this is my test text'  text  0,0  'this is my test text' fill black  text -1,-1 'this is my test text'" +matte stamp_mask79.png
composite.exe -compose CopyOpacity  stamp_mask79.png  stamp_fgnd79.png  stamp79.png
Any help is greatly appreciated

Re: Creating an image with multi line text

Posted: 2009-09-21T23:06:29-07:00
by anthony
-draw will not honor \n. Basically because SVG images will nto do so.

You need to use -annotate to get this and the % escapes in the string.
You can also create multi-line image with label: or eve word-wrapped images with caption:

see Annotate
http://www.imagemagick.org/Usage/#annotate
See multi-line labels
http://www.imagemagick.org/Usage/text/#label_lines

You may like to look at the new -interline-spacing option
http://www.imagemagick.org/Usage/text/# ... ne-spacing

Re: Creating an image with multi line text

Posted: 2009-09-21T23:56:54-07:00
by Bonzo
Here are some tests I did a couple of years ago:
http://www.rubblewebs.co.uk/imagemagick/notes/wrap.php

Re: Creating an image with multi line text

Posted: 2009-09-22T19:02:35-07:00
by BassTeQ
Thanks for the replies, It's working as I need now!

Cheers