GetTextBoundsParams

Show Deprecated
Not Replicated

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

Code Samples

This example shows how you can use TextService:GetTextBoundsAsync().

It measures the size of some text in a specific font, then prints the result.

TextService: Measuring text size

local TextService = game:GetService("TextService")
local params = Instance.new("GetTextBoundsParams")
params.Text = "hello world!"
params.Font = Font.new("rbxasset://fonts/families/GrenzeGotisch.json", Enum.FontWeight.Thin)
params.Size = 20
params.Width = 200
local size = TextService:GetTextBoundsAsync(params)
print("The size of the text is:", size)

Summary

Properties

Properties

Font

Read Parallel

RichText

Read Parallel

Size

Read Parallel

Text

Read Parallel

Width

Read Parallel

Methods

Events