This class is a Service! It is a top-level singleton which can be retrieved using the
This item is not replicated across Roblox’s server/client boundary.
This object cannot be created with the Instance.new constructor function.
The TextService is a service internally responsible for handling the display of text in the game.
This class has two member functions,
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.
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.
Filters a string being received from a user, and returns a
TextFilterResult which can be used to distribute the correctly filtered text accordingly.
DataType/Vector2 dimensions (in pixels) that will be taken up with text when using the specified formatting parameters and size constraints.