Font:getWidth

Returns the maximum width of a piece of text. This function does not perform wrapping but does respect newlines in the text.


width = Font:getWidth(string)

Arguments

NameTypeDescription
stringstring The text to measure.

Returns

NameTypeDescription
widthnumber The maximum width of the text.

width = Font:getWidth(strings)

Arguments

NameTypeDescription
stringstable A table of colored strings, each given as a { color, string } pair. The color can be a Vec3, Vec4, table, or hexcode.

Returns

NameTypeDescription
widthnumber The maximum width of the text.

See also