Rich Text Not Working with Font Tag After Runtime Edits

Reproduction Steps

Reproduction Place File: Repro.rbxl (37.7 KB)

All you need to do is hit Play. The issue happens every time on my machine. The code to reproduce the issue is very simple:

local label = script.Parent.Label
label.Text = '<font face="Arcade">TEST</font> text'
task.wait(2)  -- (need to wait for rendering to at least start)
label.Text = 'text'
task.wait(1)  -- (just need to delay at least 1 frame)
label.Text = '<font face="Arcade">TEST</font> text'

If you perform the above sequence in Edit mode, it also happens consistently (i.e. doesn’t have to be in Play mode).

System Information

CPU: Intel(R) Core™ i9-10850K CPU @ 3.60GHz
GPU: NVIDIA GeForce RTX 3070
Memory: 32.0 GB

Expected Behavior

I expect the text to render according to my rich text specifications after editing that text in scripts.

Actual Behavior

The text does not render according to my specifications, but ignores any <font> tags after clearing those tags for more than one frame.

Before the script edits the text:
After removing the <font> part of the text:
After re-inserting the <font> part:


There is a “half” workaround, but it requires leaving some character of the rich-text <font> always present, and it doesn’t work in every scenario.

Explaining the workaround in code, you need to change what I listed in the reproduction code to this:

local label = script.Parent.Label
label.Text = '<font face="Arcade"> TEST</font> text'
label.Text = '<font face="Arcade"> </font>text'
label.Text = '<font face="Arcade"> TEST</font> text'

As you can see, I make sure there is always at least a space before any normal text. When I do this, the <font> is preserved. However, this isn’t a perfect workaround, because this only seems to work if the <font> section comes first, which doesn’t apply to every use-case. And, needless to say, requiring all text to start with a space is not convenient when laying out UI.

Workaround Place File: Workaround.rbxl (37.7 KB)

Issue Area: Engine
Issue Type: Display
Impact: High
Frequency: Constantly
Date Last Experienced: 2022-08-11 00:08:00 (-05:00)

1 Like

Thanks for the report! We’ll follow up when we have an update for you.


While there are still some issues with RichText, I believe this specific bug has since been resolved (the repro at least no longer occurs). Would you @thirdtakeonit be able to confirm this so I can mark this as resolved? (don’t want people to think this is still an issue)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.