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

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
Marsu42
Posts: 75
Joined: 2014-06-12T03:17:45-07:00
Authentication code: 6789
Location: Berlin

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

Post by Marsu42 » 2014-09-26T23:24:41-07:00

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?
Last edited by Marsu42 on 2014-09-30T06:35:15-07:00, edited 1 time in total.

User avatar
fmw42
Posts: 25408
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 » 2014-09-27T09:57:22-07:00

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.

User avatar
Marsu42
Posts: 75
Joined: 2014-06-12T03:17:45-07:00
Authentication code: 6789
Location: Berlin

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

Post by Marsu42 » 2014-09-30T06:37:45-07:00

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

snibgo
Posts: 12016
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo » 2014-09-30T07:22:50-07:00

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.
snibgo's IM pages: im.snibgo.com

Post Reply