Description

Text widget with Outline uses 2 LayerId levels to draw the outline and the text glyphs. This can be seen in function FSlateElementBatcher::AddShapedTextElement(), where lambda BuildFontGeometry() is called twice with "Layer" and "Layer+1" when the font has an outline.

Earlier in the call chain, function FSlateTextRun::OnPaint() keeps track of how many LayerIds were used. It increments "LayerId" once when calling FSlateDrawElement::MakeShapedText() to draw a drop shadow if "ShouldDropShadow" is true (this is correct and does not affect the bad behavior of the outline). Then, it increments "LayerId" by only 1 more when calling FSlateDrawElement::MakeShapedText() to draw the Text with Outline. The second layer used there is never accounted for.

Adding "if (Style.Font.OutlineSettings.OutlineSize > 0) ++LayerId;" to the end of function FSlateTextRun::OnPaint() seems to be one possible way to fix the issue.

Note: This is a regression, it worked correctly in UE 5.2 but not in UE 5.3 up to latest.

Steps to Reproduce

1. Create and edit a new Widget Blueprint
2. Add a Canvas Panel
3. Add a Text to the Canvas Panel
3.1. Set "Color and Opacity" to non-white (e.g. Opaque Yellow)
3.2. Set "Outline Size" to any number greater than 0 (e.g. 2)
4. Add an Image to the Canvas Panel
4.1. Make it cover part of the text
4.2. Set "ZOrder" to -10
4.3. Note that the text and outline display in front of the Image
5. Add an Image to the Canvas Panel
5.1. Make it cover a different part of the text
5.2. Set "ZOrder" to +10
5.3. Note that the outline displays behind the Image, but its outline does not.
6. [Optional] Back on the first image...
6.1. Change its "ZOrder" from -10 to +5
6.2. Note that the text is now totally behind the image with ZOrder +10, but still partially in front of the image with ZOrder +5.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-290372 in the post.

0
Login to Vote

Unresolved
ComponentUE - Editor - UI Systems
Affects Versions5.35.45.55.65.7
Target Fix5.7
CreatedMay 27, 2025
UpdatedMay 27, 2025
View Jira Issue