Page 1 of 1

label text sizing help

Posted: 2012-08-21T19:49:04-07:00
by breezin
Having an issue I just can't figure out. We've recently moved servers and some code that used to work on the old server is giving me some trouble. There seems to be a threshold on the label text length where once over a certain length it will no longer resize properly. For an example to show this it is easier to just set a fixed label and then resize the imageā€¦ It will resize fine down to a certain width and then the text just goes to super small.

The only change is going from a size of 125x to 120x and the output is totally different.

Any ideas?

Version: ImageMagick 6.7.9-0 2012-08-21 Q16

Code: Select all

/usr/local/bin/convert -size 125x15 -gravity center -background lightblue -fill '#324C7D' -font /usr/local/lib/ImageMagick/config/colle3.ttf label:'TEST HIGH SCHOOL' -rotate '0' -distort Arc '' test_label.png
Image

Code: Select all

/usr/local/bin/convert -size 120x15 -gravity center -background lightblue -fill '#324C7D' -font /usr/local/lib/ImageMagick/config/colle3.ttf label:'TEST HIGH SCHOOL' -rotate '0' -distort Arc '' test_label.png
Image

Re: label text sizing help

Posted: 2012-08-21T20:07:00-07:00
by fmw42
label: has had some changes to try to fix things like this. It could still be a bug. see http://www.imagemagick.org/script/changelog.php

It could be a font metric issue, also. But why not just leave off the -size or specify the width or height only and let it find the best pointsize?

Why do you have -distort arc in the command with no value?

Re: label text sizing help

Posted: 2012-08-21T20:26:59-07:00
by breezin
Sorry, I just pulled the output from my class that manages the image options. Rotate, Arc, etc are options but just didn't have anything set for them. I ran the code again without the extra stuff and removed the font setting and get the same result:

Code: Select all

/usr/local/bin/convert -size 120x15 -gravity center -background lightblue -fill '#324C7D' label:'TEST HIGH SCHOOL' test_label.png
Image

Code: Select all

/usr/local/bin/convert -size 115x15 -gravity center -background lightblue -fill '#324C7D' label:'TEST HIGH SCHOOL' test_label.png
Image

I also tried to just use -size 115x and left the height blank and got the same result. For our situation we have a fixed location and size that we need to force the text to fit into. But once the text get to a certain length it just pops to that super small size.

Just can't figure this out....

Re: label text sizing help

Posted: 2012-08-21T21:52:49-07:00
by fmw42
It would appear to be a bug.

I have reported my tests at posting.php?mode=post&f=3