How is text rendered in terms of the Y axis?

Former Member
Former Member

Hello.

I was making my own calculations to render text dynamically on different lines, and I started wondering what the Y means when you call renderText. Does that Y represent the center of the text? or is it the baseline of the text? Or maybe it renders the text from top to bottom starting at Y?

Digging docs I found getFontDescent and getFontAscent. Contrary to my intuition, I just need to sum getFontAscent (I was expecting to have to use descent) to get the next line where I can render text without overlapping. That does not invalidate my question... How is the text rendered so I have to use the amount given by getFontAscent? What does the Y on render text mean?

And in similar topic, do you manually calculate the X offset for round screens or there is any built in function that I didn't found yet?

Thanks for your help.