measureText

common
fun measureText(textNode: TextNode): RectGeom

Returns the bounds of the TextNode, no transformation is applied.

  • the Rect position returned is the same as the TextNode

  • the Rect is the same as the TextNode

  • the Rect position may vary depending on the TextNode alignment properties

Return

A Rect which Rect.topLeft position is the TextNode top-left position, and Rect.width is TextNode width.

Parameters

textNode

a TextNode with all properties set.

common
fun measureText(text: String, font: Font): RectGeom

Returns the bounds of a text to be drawn on screen.

Return

A Rect which Rect.topLeft position is the text top-left position, and Rect.width is text width.

Parameters

font

a Font this text uses.

text

a String to be displayed.

js
fun measureText(text: String, font: Font): RectGeom

Returns the bounds of a text to be drawn on screen.

Return

A Rect which Rect.topLeft position is the text top-left position, and Rect.width is text width.

Parameters

font

a Font this text uses.

text

a String to be displayed.

fun measureText(text: String, font: Font): RectGeom

Returns the bounds of a text to be drawn on screen.

Return

A Rect which Rect.topLeft position is the text top-left position, and Rect.width is text width.

Parameters

font

a Font this text uses.

text

a String to be displayed.