Tl;Dr:
Tabs are smaller than or equal to a single space when displayed in a Roblox TextObject.
That’s bad behavior. Please fix.
Within a TextBox/Label/Button, "\t"
is displayed smaller than or equal to a " "
.
This means that any attempt at displaying indented text does not work.
SourceSans:
Code:
Arial:
Gotham:
Why is tab smaller than space?
I know some people will say to just do global substitution to multiple spaces:
TextBox:GetPropertyChangedSignal("Text"):Connect(function()
TextBox.Text = string.gsub(TextBox.Text, "\t", " ")
end)
This is flawed.
Not only will this mess up the user’s CursorPosition every time they indent, but it means that if they want to traverse it via the arrow keys or to backspace it, it becomes 4 key presses instead of 1.
Currently, I use global substitution but manually move the CursorPosition based on changes I make. I still have to work out exactly to solve the 4:1 keypress issue. Or…
Roblox should handle tabs properly, and we shouldn’t be forced to sacrifice UX, CPU, and development time for such a basic feature.
Back in 2015, @TheNexusAvenger made this very short feature request that says the opposite. This implies that, once upon a time, Roblox actually did allow tabs. We should go back to that, rather than remove core functionality from a vague 2 sentence request. (No hate to Nexus tho <3)