RichText limits? Breaking?

I’m working on a custom Studio Script Editor Plugin.
I thought I had the colored syntax highlighting working, but now it’s breaking.

2020-10-25_04-41-25

Is this because of a limitation with RichText?

2 Likes

I am not sure of the limitations of RichText, however, from what it appears, I assume that there is a length limit for the RichText. In the future it will probably be resolved, but for the time being, I would recommend the following:

  • I would go about this by first of all determining how long it is (roughly) when the text breaks.
  • Secondly, script it so that it creates multiple text labels rather than that one really long one.
  • Determine when and how large to make the new text label, to make it optimized so that there isn’t loads of labels.

Hope this helps! :slight_smile:

1 Like

That’s an interesting solution, I’ll keep it in mind.
I’m probably going to end up using layered TextLabels instead of RichText.
Thanks for the input.

I just ran into this issue. Do you by chance know the length at which it breaks? It would greatly help me! Thanks in advance!

Alright so there appears to be a limit on the amount of RichText that can be rendered at one time, even on separate TextLabels.


In the image above, the top TextLabel I limit the amount of Text on it. After several tests, I concluded that the limit is somewhere near 4.49 kb (#String/1000 = kbAmount). If I still go above this limit just a bit, enough for there to be text so that there’s another TextLbael, the second TextLabel will have the RichText rendered but not on the first:

This makes me assume that there’s a limit to how much RichText can be rendered overall instead of per TextLabel. The length of the text is #txt/1000 = 4.787.

For anyone wondering, the characters <3 was breaking RichText. So double check near where it breaks incase you need to XML encode, so for the example above it would be &lt;3 and for OP it would need to change all less than characters to &lt;

If you are using one large text label / box you should have a different one per line, and then use :Focus and :ReleaseFocus to move between the lines