font = love.graphics.newFont(24) -- whatever size you need, I suspect 24 is good
(Make sure you do this in love.load or similar; as in, only call it once.) Then to get the width and height, use this Font:getWidth and Font:getHeight:
Uh, that's one way to do it. Or you could just use love.graphics.printf with the AlignMode "center".
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit! Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
I thought printf aligned it vertically? Oh well, if not, it would just be a matter of adding a fixed offset to its position.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit! Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Does getHeight() account for the height of the letter box? Or the current characters? What I mean is "a" is smaller than "l" which would have a different box than "g" and all together you'd have "alg" which would span from the top of the l to the bottom of the g. Would getHeight() return that height even if it's just "a" or "al" or "ag"? (I'm unable to test it right now)
No getHeight() doesn't account for any characters, it's a property of the font itself, because getHeight() doesn't receive any arguments (like getWidth() does). I'm not exactly sure what the number it returns relation is with the size you specify, but I do know it's the height. For example, the default font with a size of 12 has a height of 14, 14 is 16, 32 is 42, and 72 is 84, so yeah.
I'd have thought it was the X-Height of the typeface, which is most likely specified here as the number you give when you create the font object.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.