GetTextBoundsParams
Show Deprecated
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
The Font of the text being measured.
The size of the text being measured.
The text being measured.
The width of the container for line breaking.