Page 1 of 1

Caption text with stroke cut off. LATEST build. Solve/hack?

Posted: 2012-08-22T18:28:17-07:00
by oarion7
Greetings

Fresh compilation of latest imagemagick source, on Ubuntu Lucid.
convert version: ImageMagick 6.7.9-0 2012-08-22 Q16 http://www.imagemagick.org


I am trying to generate a close-fitting white "cloud" or "speech bubble" closely surrounding/following the shape of generated black text.
The resulting generated image must be word-wrapped (hence "caption" here)
The resulting generate image must fit within a 260px-wide square (hence the specification via "size")

Applying a heavy stroke to text entered via "caption" yields favorable results except that are cut off on the right side. If I generate the black text via caption all by itself, it displays nicely within the dimensions. With both generated together, as below, both the black text and the white cloud text are cut off to the right, as pictured.

What I have:

Code: Select all

convert -background gray  -fill white  -gravity center -font /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf -pointsize 16 -size 260x -stroke white -strokewidth 25 caption:'Sample writing, text cut off to the right' -background transparent -fill black -stroke none caption:'Sample writing, text cut off to the right' -gravity center -compose over -composite caption.png
Result:
Image

I would appreciate any advice. A hack that requires a couple of commands is fine if necessary. Thanks to anyone who can help!

Re: Caption text with stroke cut off. LATEST build. Solve/ha

Posted: 2012-08-22T18:54:27-07:00
by anthony
Define either pointsize, or image size, not both.
This will make IM resize the missing part to match.

see IM examples, Labeling
http://www.imagemagick.org/Usage/text/#label

Re: Caption text with stroke cut off. LATEST build. Solve/ha

Posted: 2012-08-22T19:00:53-07:00
by fmw42
Anthony, I tried that by removing the pointsize, but that did not help.


Looks like a caption bug. Have you tried Pango: rather than Caption:

See
http://www.imagemagick.org/Usage/text/#pango
http://www.imagemagick.org/script/formats.php#pseudo

Note you have to install PANGO. Then recompile IM.

Re: Caption text with stroke cut off. LATEST build. Solve/ha

Posted: 2012-08-22T19:07:28-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.7.9-1 Beta, available by sometime tomorrow. Thanks,