UIStroke does not work with Rich Text + private video for Staff with explanation

Description

To best explain the key component of this issue, you’d have to think about the expression !important from CSS.

I see the UIStroke Instance as an equivalent of overriding style behavior, similar to !important from CSS.

However, UIStroke does not work on Rich Text.

 

The Documentation even mentions the following:

  • Use rich text tags to add stroke to inline text segments.

A bit funny, but it is possible. But the docs also specifically mention the word inline. For separate areas on the Rich Text.

 

Rich Text has special features (like larget text scaling). It is questionable whether they’re intended or not, but it’s better for Roblox to not break these features without fixing and keeping the features as fixed versions. My private video for Staff, explains more why.

Re-production Steps

  1. Setup ScreenGui in StarterGui
  2. Setup TextLabel
  3. Turn on RichText for the TextLabel
  4. Try to add UIStroke under the TextLabel
  5. Observe

 

 

Expected Results

That the UIStroke on Rich Text will give me a Base Stroke Style.

 

Actual Result

It even displays me this even though it’s not doing anything.

 


A private message is associated with this bug report

1 Like

This is just an acknowledgment announcement!

We’ve filed a ticket into our internal database for this issue, and we will update you when we have further information!

Thanks for the report!

Just bumping this because it makes it annoying to use Rich Text. Any UIStroke styling applied to text will be overriden, and then I am forced to convert all that styling into the rich text format which is just pointless busy-work.

UIStroke.LineJoinMode = Enum.LineJoinMode.Round
UIStroke.Color = Color
UIStroke.Thickness = Thickness
TextLabel.Text = "Some <b>bold</b> text"

must become

TextLabel.RichText =
   ("<stroke color=\"#%s\" joins=\"round\" thickness=\"%s\">Some <b>bold</b> text</stroke>")
   :format(Color:ToHex(), tostring(Thickness))

Hey, this issue is fixed and rolled out now! All 3 types of stroke, RichText#stroke, UIStroke, and TextStroke, should all overlap properly and work as intended now.

4 Likes

Seems to work.

What I question though is whether UIStroke should be superior and define base values. If I wrap a portion of a text inside <stroke></stroke> I am able to modify the stroke, but if I only wanted to modify the color and keep UIScale’s thickness, I can’t. The thickness from the UIScale doesn’t apply over, I have to use thickness and set it manually.

 

But what would be the point of that? What would the ideal solution be? Wrap the entire text inside <stroke> itself to provide “base values” ?

Isn’t that what UIStroke is supposed to do already?

Though, based on how <stroke> works, doing <stroke color="#ff0000">Test <stroke>hello</stroke></stroke> already makes “hello” have a black stroke, instead of red, so I guess <stroke> never had this sort of “inheritance”.

The Roblox team (or you) released a significant fix without any announcement, but thanks a lot! I thought it was an intended feature, but now it’s so much better. I no longer have to use etc., for BillboardGuis

I just went through my game and fixed a few ‘oopsies’ where we had UIStrokes on RichText without us knowing, if anyone else has to do that here a command prompt:

local Selection = game:GetService("Selection")

local Stop = false
for _,v in ipairs(game:GetDescendants()) do  
	if Stop then
		break
	end

	pcall(function() 
		if v.RichText == true and v:FindFirstChildOfClass("UIStroke") then 
			local Stroke = v:FindFirstChildOfClass("UIStroke")
			--Stop = true
			print(Stroke)
			--Selection:Set({Stroke})
		end 
	end) 
end

Is there an ETA on when this is pushed out on all platforms?
It’s currently active on PC (Windows), but not on mobile (Android)

There is now a discrepancy between devices

This has now been rolled out on all devices.

1 Like

Thanks alot : )
I also have this on my phone now :+1: