I am attempting to center text in a rectangle. The attached PNG shows that the text is drawn too far left in the bounding (black) rectangle, because the text rectangle (red) is too wide.
I am using the getCurrentFont() on the Graphics, so I am definitely using the same Font for measuring and for drawing. I'm using the getStringWidthFloat() function to get the right extent.
The same occurs on Linux and OS X, so it's not OS specific. And before you ask: there is no trailing whitespace in the string, and if I change the starting offset I draw at, the end remains at the same relative offset.