Page 1 of 1

"label"->"annotate" auto-fontsize problem [invalid, delete]

Posted: 2014-09-26T23:24:41-07:00
by Marsu42
I'm experiencing a weird issue I think could be a bug or bad behavior on im's side with the free font "Stark". I'm trying to find the best pointsize to fit a caption into a pre-determined width with "label"...

Code: Select all

convert -quiet -ping ( -size 1000x -background black -fill white label:"%string%" ) -format "width=%w\npointsize=%[label:pointsize]" info:
... and then use the pointsize read from this command for "annotate".

But with some strings, the "annotate" width is too large - I checked this by comparing the "label" width from the above command with a measurement using and image editor for the "annotate" result.

It just managed to narrow it down to the font used: If I use the stock "Arial" it works in all cases, the problem only occurs when using the free font "Stark". But why would it do that? Is the code used for determining the point size with label: different from writing with "annotate" so that "Stark" renders in a different way?

Re: "label"->"annotate" auto-fontsize problem

Posted: 2014-09-27T09:57:22-07:00
by fmw42
The font stark may not have accurate glyph information. By the way, I do not see any font specified in your command. An example with images would be helpful to demonstrate your problem with the exact commands and information used. Also your version of IM and platform. If you are using an older version of IM, there could have been a bug that has been fixed.

Re: "label"->"annotate" auto-fontsize problem

Posted: 2014-09-30T06:37:45-07:00
by Marsu42
fmw42 wrote:By the way, I do not see any font specified in your command.
Damn, you're correct - I didn't see the wood because of the trees as my im command line has grown to nearly unmanageable size by now: I've really forgotten the font statement in when probing for the pointsize, that's why it worked with the standard Arial, but not with the fancy Stark.

So sorry for taking your time, please delete the whole thread if possible - but I guess these mistakes happen to most of us now and again :-o

Re: "label"->"annotate" auto-fontsize problem [invalid, dele

Posted: 2014-09-30T07:22:50-07:00
by snibgo
These things happen to all of us.

You can edit your first post, inserting [SOLVED] in the title.

I wouldn't delete the thread. It will be useful when someone has a font problem, sees your thread, and is prompted to check that they actually specified a font.