getWidth

fun getWidth(context: MeasuringContext, text: CharSequence? = null, maxWidth: Int = DEF_LAYOUT_SIZE, maxHeight: Int = DEF_LAYOUT_SIZE, rotationDegrees: Float = 0.0f, pad: Boolean = text == null): Float

Returns the width of this TextComponent for the given text and maximum dimensions. pad defines whether to extend text by such a number of blank lines that it has lineCount lines.