Skip to content

Class · inherits Instance

GetTextBoundsParams

Official docs ↗

Use with TextService.GetTextBoundsAsync to measure the size of text.

About GetTextBoundsParams

Pass this instance to TextService.GetTextBoundsAsync to measure the size of text.

Properties 5

  • Font: Datatype.FontThe Font of the text being measured.

    The Font of the text being measured. Corresponds to the TextLabel.FontFace property on text objects.

    Not to be confused with Font. This is an object that you can create using Font.new.

  • RichText: booleanDetermines whether the measured text is interpreted using rich text markup.

    Determines whether the text being measured is interpreted using rich text markup. Corresponds to the TextLabel.RichText property on text objects.

    By default, the value is false, meaning the GetTextBoundsParams.Text string is measured verbatim. When set to true, rich text formatting tags in the string are parsed rather than measured as literal characters, so the returned bounds reflect the styled text.

  • Size: floatThe size of the text being measured.

    The size of the text that is being measured. Corresponds to the TextLabel.TextSize property.

  • Text: stringThe text being measured.
  • Width: floatThe width of the container for line breaking.

    The width of the container for line breaking. By default, the value is 0, which means no line breaking will be performed. You can set it to the width of the container that you'll be putting the text into.

GetTextBoundsParams also has every member of Instance. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.