Using RichText slightly offsets all text except for first line

This happens for all RichText-enabled instances from what I’ve seen (not just TextBox instances). You can reproduce this (all studio beta features off) by placing any text element in a GUI, inserting text that contains newlines, and toggling the RichText property. The below gif is a TextLabel with its text set to test\ntest\ntest.
2021-07-16_20-06-39
I have also been running into this issue trying to create a syntax highlighter, same as OP. This has been an issue since RichText was released afaik (amost a year ago now), it’d be nice to see some kind of confirmation this is known/being looked into.


Edit: A temporary (and probably unreliable) workaround for this is to offset your actual text input box to the right by 4 to align it with this indentation, move your visible text label up by your text size, and ensure that whenever the visible text label is updated, a newline is inserted at the very beginning of the text. I also made my input text box a TextTransparency of 0.5 as it removed a bit of the distortion/cursor and selection looked nicer imo.

5 Likes