RichText [TextScaled Support Added]

This bug has already been reported several times.

Will we ever see this feature rollover to the Roblox Chat? Or does it use it by default now? I was about to make a module that I want to use colored text in the StarterGui:SetCore("ChatMakeSystemMessage") and remembered RichText was now live.

Any updates on when weā€™ll be getting <br>?

I noticed you said you guys have it implemented but itā€™s not released yet.

Iā€™m working on a thing for syntax highlighting.
I have a TextBox that the user can type in and a TextLabel on top which mimics the TextBox except it adds color using RichText. The only problem is RichText likes to shorten multiple new lines into a single new line, so it throws everything off sync.

Other people seem to be running into a similar situation

It would be great if we could have <br> support, or support for multiple new lines in RichText :heart:

TLDR: Yet another request for <br>

Another solution I tried was using a special character with 0 width

local noWidthChar = "ā€‹"

--- bla bla bla
TextLabel.Text = TextLabel.Text:gsub('\n','\n'..noWidthChar)

For some reason Roblox changes the 0 width character to some sort of obstructed character
no idea why

EDIT:
I donā€™t know why Roblox doesnā€™t like the no width character directly, but you can produce something very similar with this:

TextLabel.Text = TextLabel.Text:gsub('\n','\n'..utf8.nfcnormalize(""))

Itā€™s not a perfect no-width character, but itā€™s very close. Itā€™s an invisible character with a width of 4 pixels.
I think itā€™s supposed to be the same character, because all I did was format the character into utf8 to then format it back, but I donā€™t know enough about this to say for sure. Either way, with a little offset, I can make a haxy custom <br> functionality!

Iā€™m just going to use this for the time being until an official <br> is released.

3 Likes

Are there limitations to RichText? Is it supposed to just stop working?
2020-10-25_04-41-25
I donā€™t know if this is a bug or a known limitation but RichText seems to break after a certain number of tags.

If it is a limitation, itā€™s not very well documented.
Thereā€™s nothing about such a limitation anywhere in the api wiki, article, or this post.

3 Likes

So does anybody have a solution to TextScaled not working? I understand it has already been reported but Iā€™ve read through the forum and I donā€™t see a way to fix this while we wait. I want to use this in a notification system and itā€™s crucial that the text scales.

What about to set textā€™s size by its frameā€™s absolute Y size?

Hi, @CboatDev.

Yes, Iā€™ve found a way around it. In order to have things scaling, add a UIScale and set the scale based on a screen resolution. For instance, use 1920x1080 to be your UIā€™s target resolution and change the UIScaleā€™s Scale property in order to have everything scaling properly depending on screen sizes. In fact, this solution is far beyond being RichText-only. It expands to multiple GuiObjects.

Best regards,
Octonions

1 Like

Thanks for your help. Iā€™m just going to hold off on using rich text until they figure this out. Why canā€™t they just disable TextScaled when you use font size tags?

I believe ROBLOX has to do more than that to make it fit for everyoneā€™s use.

No text scaling is a dealbreaker for me. Any plans to add this?

Thanks for your patience! We are actively working on this and the timeline expectation would take around 2 weeks more.

2 Likes

We have internal size limitation on the text property on textobject. We are looking into bumping that one for better richtext support.

3 Likes

Perhaps a feature such as a property named ā€œDisplayed textā€ under both textboxes and textlabels would fix the prevention of using richtext on input. it would greatly improve the feature usage on more than just bland non user generated texts.

this properly would basically be a read-only of the .Text property just without any html if richtext is enabled.

Until this is implemented (if ever) user generated content can be filtered from html with a simple line:

local NonHTML_Text = text:gsub("%b<>", "")

sadly this would take stuff like <hi I'm voided> in account so feel free to modify it to specific cases only

1 Like

Indeed, @VoidedBlades.
I vouch for that as well.
I have been using something similar. Although your method seems faster and cleaner, I am going to post what I have been using as well.

local displayedText = string.gsub(text, "<.->", "")

Not sure if it works for all cases, but it has been working for me.

Best regards,
Octonions

1 Like

Thanks for your suggestions~ We actually have this feature implemented. We will release it sometime later.

1 Like

Is the <img> tag on the roadlist? I havenā€™t got any response to my last question.

4 Likes

Iā€™m having the same problem did you found a fix?

Can we get RichText support for bubble chat? Iā€™m developing a rich text system and this would help tons.

2 Likes

does the TextFits property work in richtext? i tried it with some code but it behaves incorrectly for me, but im not sure because it can be my codeā€™s problem

You can do it easily for yourself, just start the game and under the chat service on explorer there are a lot of scripts, copy them stop the game paste them to somewhere and then explore it you will find some function that makes bubblechatā€™s eventually, then you can set the richtext property there to true.