Page 1 of 1

Text Positioning

Posted: 2007-09-19T03:01:39-07:00
by Neko
Hi,

I need a bit help with text positioning in y-dimension. I read somewhere ImageMagick uses the baseline of the text for positioning text in that dimension, is that confirmed? I need to position some text centered to other graphic objects and tried it by gathering the data via QueryFontMetrics, but obviously there's no data in the output how the baseline is related to the image height or did I miss something?

Any helpful thoughts on this?

Thanks

Re: Text Positioning

Posted: 2007-09-22T01:05:43-07:00
by Neko
Ok, maybe the question was to specific. Can anyone tell me in the first place where the 'anchor' (as in the coordinates that are given to annotate) in relation to the text is exactly?

Second question is then how do you align text centered (between to lines for example) in the y-direction.

Re: Text Positioning

Posted: 2007-09-22T04:15:20-07:00
by Bonzo
You can use -gravity Center -annotate +0+0 and modify the position with the +0+0

Or you can use -draw \"gravity center fill black text 0,0 and modify the position with the 0,0

Some examples here: http://www.rubblewebs.co.uk/imagemagick/text.php

Have you checked out Anthonys examples ?
http://www.imagemagick.org/Usage/