Page 1 of 1

Text does not wrap correctly

Posted: 2016-08-29T02:37:11-07:00
by arthur
Hello,

I am having some issue trying to wrap text in a given width and pointsize.
Here is what I run:

Code: Select all

convert -size 400x -pointsize 50 caption:'This does not wrap' out.png
And this is what I get:
Image

I would expect "wrap" to be on a new line.

Am I doing something wrong or is this a bug?

Tested with imagemagick 6.9.5 on OSX and imagemagick 6.7.7 on Ubuntu
Probably same issue http://stackoverflow.com/questions/1158 ... -font-size

Thank you for your help
Arthur

Re: Text does not wrap correctly

Posted: 2016-08-29T03:18:19-07:00
by Bonzo
From what I know text does not automatically wrap in caption, draw or annotate but I believe it does in label.

You can force it to depending on what language you are using with \n or new lines.

Re: Text does not wrap correctly

Posted: 2016-08-29T04:32:19-07:00
by arthur
If I read the docs correctly, it's the other way around: does not wrap with label, wraps with caption
http://www.imagemagick.org/Usage/text/#caption

Re: Text does not wrap correctly

Posted: 2016-08-29T07:43:03-07:00
by snibgo
"caption:" should wrap, and generally does, eg:

Code: Select all

convert -size 200x -pointsize 50 caption:"This does not wrap" caption_200.png
Image
But:

Code: Select all

convert -size 400x -pointsize 50 caption:"This does not wrap" caption_400.png
Image

Looks like a bug to me.

v6.9.5-3 on Windows 8.1.

Re: Text does not wrap correctly

Posted: 2016-08-29T09:41:38-07:00
by fmw42
Caption will not split a word to wrap. But it should wrap between the not and wrap words.

Re: Text does not wrap correctly

Posted: 2016-08-29T10:04:42-07:00
by arthur
Thank you everybody.
I have opened a similar thread in the Bugs section and I think we should continue there: viewtopic.php?f=3&t=30376