Page 1 of 1

Caption uses tiny text

Posted: 2015-06-11T12:34:52-07:00
by powerofvoid

Code: Select all

convert -size 300x700 caption:"fe fi fo fum" test.jpg
Got the left, expected something more like the right
Image Image

Code for the right side version:

Code: Select all

 convert -size 300x700 -pointsize 180 caption:"fe fi fo fum" test2.jpg

Might be because I went back to using an old version of imagemagick when I reinstalled.

Code: Select all

convert --version
Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP    

Re: Caption uses tiny text

Posted: 2015-06-11T13:41:46-07:00
by fmw42
You need an upgrade. It works fine for me with

Code: Select all

convert -size 300x700 caption:"fe fi fo fum" test.jpg
using IM 6.9.1.4 Q16 Mac OSX. Very similar to your right side image.

Your IM version is about 140 versions old!

Re: Caption uses tiny text

Posted: 2015-06-11T14:17:28-07:00
by powerofvoid
I'll try that

Re: Caption uses tiny text

Posted: 2015-06-11T14:55:45-07:00
by powerofvoid
Well, that works for small amounts of text, but...

Code: Select all

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut pellentesque auctor pulvinar. Ut semper enim mauris, a gravida leo eleifend quis. Integer semper odio sapien, ut dictum nunc sagittis ut. Cras bibendum erat sit amet lorem malesuada varius. Pellentesque tempor, sapien vitae tempus euismod, purus dui eleifend odio, id facilisis ex sapien sed eros. Sed nec tortor a lectus lobortis luctus sit amet quis enim. Phasellus vel felis nibh.

Suspendisse tincidunt lacus risus. Vivamus auctor eget sem eu luctus. Maecenas ac nulla gravida, lacinia ipsum in, venenatis mauris. Nam interdum consectetur bibendum. Sed dictum, metus in consectetur fermentum, odio est luctus orci, sed efficitur metus nulla eu elit. Sed vel tristique erat, eget laoreet turpis. Pellentesque eget arcu nec lacus fermentum placerat. Donec vestibulum leo id ex mollis dignissim. Integer ut sollicitudin augue, in pharetra ligula. Morbi a mi in eros dapibus vulputate sit amet sit amet dui. Mauris mattis, sapien a lacinia iaculis, libero mi rhoncus lorem, quis eleifend metus augue eget elit.

Integer placerat convallis ipsum, vitae placerat nulla vehicula id. Sed ut mi purus. Mauris placerat justo nibh, eu sodales orci blandit vitae. Donec cursus elementum auctor. Suspendisse mauris diam, aliquam sit amet neque et, dapibus malesuada lectus. Suspendisse et tristique nulla. Aenean libero erat, malesuada ac massa a, faucibus tincidunt neque. Phasellus eu nibh posuere, commodo leo id, rhoncus leo. Maecenas ac laoreet odio. In hac habitasse platea dictumst. In sit amet sapien nec lectus vestibulum vestibulum vestibulum ac felis. Aliquam imperdiet semper erat, at laoreet nisi iaculis et. Donec lacinia eu neque at semper. Phasellus ligula magna, consequat sed rhoncus ac, tempor at dui. Suspendisse imperdiet viverra turpis in varius. Curabitur a congue enim, sit amet sagittis lorem.

Vestibulum pharetra quis urna at pharetra. Cras vitae consectetur ipsum. Aenean et dapibus odio. Phasellus enim felis, condimentum nec quam sed, tempor ultricies purus. Nulla facilisi. Phasellus aliquet molestie eros, sit amet lacinia felis. Fusce tempor enim et elit mollis, vel bibendum dui sagittis. Vestibulum vehicula sit amet nisl vel mattis. Proin non cursus ex. Sed tristique lectus eros, nec consequat risus aliquet eu. Ut dui mauris, euismod eu pulvinar eu, sodales sit amet dui. Pellentesque euismod egestas velit, at imperdiet eros molestie nec.

Code: Select all

convert -size 300x700 -caption:@lorempipsum.txt test5.jpg
Image

Re: Caption uses tiny text

Posted: 2015-06-11T15:28:51-07:00
by fmw42
convert -size 300x700 -caption:@lorempipsum.txt test5.jpg
No -caption: ---- remove the minus before caption

My guess is that there is too much text for the smallest pointsize you have on your system for the default font and this may mess up IM's ability to render it properly.

If you cut back on the amount of text and slowly build up, it seems to work fine, until you reach a point where it has no smaller fonts to use.

At that point, you will need to specify the desired pointsize that works for you. Such as

Code: Select all

convert -size 300x700 -pointsize 11 caption:@lorempipsum.txt test5.jpg

Re: Caption uses tiny text

Posted: 2015-06-12T10:14:39-07:00
by powerofvoid
fmw42 wrote:
convert -size 300x700 -caption:@lorempipsum.txt test5.jpg
No -caption: ---- remove the minus before caption

Code: Select all

convert -verbose -size 300x700 caption:@lorempipsum.txt test.jpg
Well, now it just keeps running for several minutes with no output.
My guess is that there is too much text for the smallest pointsize you have on your system for the default font and this may mess up IM's ability to render it properly.

If you cut back on the amount of text and slowly build up, it seems to work fine, until you reach a point where it has no smaller fonts to use.
Except that, as you pointed out, 11point font seems to work fine. Why is it using a font smaller than 11p?

Re: Caption uses tiny text

Posted: 2015-06-12T11:11:48-07:00
by fmw42
caption: without the minus is correct. Sometimes it takes a long time to render and if it is confused about the correct size, then it could be slow. Does it work without the line breaks?

Perhaps there is a bug. The developers will need to respond.

Re: Caption uses tiny text

Posted: 2015-06-12T12:14:59-07:00
by magick
The caption code is modest in its capabilities. For more robust text, use Pango. See http://www.imagemagick.org/Usage/text/#pango. With caption, we got slightly better results by formatting the text. We used fmt -60 to reformat the text and the caption looked reasonable.

Re: Caption uses tiny text

Posted: 2015-06-12T12:55:36-07:00
by powerofvoid
Pango seems to be working much better.

EDIT: Except that it doesn't automatically assign a font size to fill the space, which is an important part of what I'm trying to do.

Re: Caption uses tiny text

Posted: 2015-06-12T14:29:15-07:00
by fmw42
magick wrote: With caption, we got slightly better results by formatting the text. We used fmt -60 to reformat the text and the caption looked reasonable.
How does one apply fmt -60? Is that a feature in the command line when using caption: or just in the caption: code? If in the code, is that being added in IM 6.9.1.5?

Re: Caption uses tiny text

Posted: 2015-06-13T06:37:52-07:00
by magick
The fmt utility is a command-line utility for formatting text. We use it from the vi editor like this:
  • -> vi lorempipsum.txt
    :%!fmt -60