getBounds

fun getBounds(context: MeasuringContext, text: CharSequence? = null, maxWidth: Int = DEF_LAYOUT_SIZE, maxHeight: Int = DEF_LAYOUT_SIZE, outRect: RectF = tempMeasureBounds, includePaddingAndMargins: Boolean = true, rotationDegrees: Float = 0.0f, pad: Boolean = text == null): RectF

Returns the bounds (RectF) 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.