Font.getTextWidth

Function/Meaning

Get the width of the string

Type
Fontclassmethod of
Syntax
getTextWidth(text)
Arguments
text

Specify the character string for which you want to obtain the width.

Return value

Returns the width of the specified string in pixels

Explanation

This method allows you to get the width you need when drawing the specified string with the current font settings.

Reference
Font.getTextHeight