TextLabel/Box/Button.AbsoluteTextSize

As a Roblox developer, it is currently impossible to know what the text size is if your gui uses text scaling. I want to position my guis based on the size of the text, but I have to reimplement scaling so that I can access that information.

12 Likes

I think the TextService’s GetTextSize method may prove to be of use. In your specific case, you have TextScaled=true but for the GetTextSize method to work as intended you may have to set your UI to use static text size increments (due to the requirement to pass in a font size) rather than smooth sizing, which may not be the best choice in all cases.

Another property that works is the TextBounds property, but this only proves reliable if there’s one line of text because the line spacing for the fonts is unknown.

Otherwise I definitely support this change because both methods I put above aren’t really the best or may not even work. Perhaps modding TextService’s API to include OP’s idea would work.

TextBounds doesn’t work because the Y-axis doesn’t necessarily represent the size of the text. If I want to make a textlabel at the same text size as the one in question then there’s no way to do that that’s 100% reliable and doesn’t require me to change the size/text to specific values.

2 Likes

I see. Well, there’s even more reason for such a request.