FontMachine - set Y-handle of font?

BlitzMax Forums/BlitzMax Programming/FontMachine - set Y-handle of font?

GfK(Posted 2014) [#1]
Hello

Does anybody using FontMachine know if it's possible to set the y-handle of the font? I'm just playing around with some GUI stuff and it'd be really useful if I could draw some text at the centre point of a button and actually have it vertically centered. Currently, the top of the font, is at the vertical centre of the button, which is not the desired result. In the past I've just manually added a Y offset for the button text, but then you get into all manner of faffy ball-aches if you need to adjust the font scale as the position needs to be re-adjusted too.

Had a look thru the docs but I can't see any non-hacky way of doing it, unless I'm missing something?


Derron(Posted 2014) [#2]
Couldnt you just align it yourself?

y - TextHeight(text)/2

Of course you will have to replace "textheight" with a fontmachine-command.


if your have access to the source code of the module, you could even check for various methods of offsetting or manually adjusting some variables of the font before and after rendering the text.


bye
Ron


GfK(Posted 2014) [#3]
Yes, I could align it myself but as I said, if I need to change the text scale then I will have to realign it. It's that sort of messing about that I'm trying to avoid.

I'm really after the "official" way of doing it, if such a thing exists.