We use cookies on this site to enhance your user experience
Collapse Sidebar


Show deprecated


Show deprecated

The TextService is a service internally responsible for handling the display of text in the game.

This class has two member functions,

The TextService/GetTextSize function gives developers the ability to calculate the space required for a specific text string with specified formatting, returning a DataType/Vector2 pixel size.

The TextService/FilterStringAsync function is required to properly filter user specified text (such as chat messages or other inputs) in the interests of user safety. Developers not using the Roblox default Chat, or allowing users to otherwise input text must use this function.

For more information on text filtering please see this article.




FilterStringAsync ( string stringToFilter , int64 fromUserId , TextFilterContext textContext )


Filters a string being received from a user, and returns a TextFilterResult which can be used to distribute the correctly filtered text accordingly.


GetTextSize ( string string , int fontSize , Font font , Vector2 frameSize )

Computes the DataType/Vector2 dimensions (in pixels) that will be taken up with text when using the specified formatting parameters and size constraints.