I know it\'s a simple concept but I\'m struggling with the font metrics. Centering horizontally isn\'t too hard but vertically seems a bit difficult.
I\'ve tried usi
Not sure this helps, but drawString(s, x, y) sets the baseline of the text at y.
I was working with doing some vertical centering and couldn't get the text to look right until I noticed that behavior mentioned in the docs. I was assuming the bottom of the font was at y.
For me, the fix was to subtract fm.getDescent() from the y-coordinate.