Font.getTextWidth

Function/Meaning
Get the width of a string
Type
Method of the Font class
Syntax
getTextWidth(text)
Arguments
text Specifies the string to get the width of.
Return Value
Returns the width of the specified string in pixels
Description
This method allows you to get the width required when drawing the specified string with the current font settings.
Reference
Font.getTextHeight