[Regression] TextBox content being cut too early or misplaced

We have an issue with TextBlock working worse than on 4.7.6. After we migrated to 4.8 the alignment stopped working and the letters begun to be cut in many places. We fought, but the issue proved to be far too deep inside the source code.

I’m attaching a blank project that works perfectly well in 4.7, is broken in 4.8 and is still broken in 4.10. The difference can be seen even in the UMG editor window, no need to launch the game. I have made maps to allow you to easily run and see it on the gameplay screen though.

Project was made in 4.7. Migrate it to 4.8 or 4.10 to see that the issue still persists. Below is a more thorough explanation of what the expected result should be. (expected == 4.7 version)

The screen is also included in the *.zip file.[link text][1]

Hello

I was able to reproduce some of the issues that you are reporting on our end with the project provided. The two that reproduced appear to be known issues. I have a couple of questions for you that will help narrow down what issues you are experiencing.

Quick questions:

  1. Was the project that was linked a clean project that was not updated?
  2. If so, could you provide a detailed set of steps to reproduce the bottom two examples (The “Some Text” and the “Text block” examples)? These were the only to that reproduced on our end.

Yes, the provided project was made in 4.7. To make sure that after migration things would not work I also did the same in 4.8 and 4.10, therefore I do know the repro steps needed. Here we go:

"Text Block"

  1. Make a clean, blank project, no starter content, 4.8.3 binary build.
  2. Create a new widget, based on standard parent - UserWidget by right clicking in the content and going ‘User Interface’ → ‘Widget Blueprint’
  3. Delete the existing canvas panel
  4. Add a ScaleBox (let’s call it Outer)
  5. Add a SizeBox as a child of the ScaleBox Outer (step 4)
  6. In the SizeBox details panel, override width and height to 1920 and 1080, respectively (FHD resolution)
  7. Add Canvas Panel as a child of the SizeBox (step 5)
  8. Add a second ScaleBox as a child of the Canvas Panel from step 7. Let’s call this ScaleBox Inner
  9. Add a TextBlock(called ‘Text’ in the UMG Palette window) as a child of the Inner Scale Box (step 8)
  10. This is when the text is cut too early. What is weird however, is that setting ‘Size to Content’ on the Inner Scale Box makes things even worse. Also, notice how the cutting on the end changes with zooming in and out. It bugs out differently on different resolutions - some texts work well on 800x600 but break in FHD, others have it the other way around. Nothing like that happened in 4.7
  11. You can change the text in the box, I found out that ‘w’ likes to be cut much deeper than other letters, so the problem is easier to visualize.

Please note, that the SizeBox is not needed to reproduce the issue. Step 5 and 6 can be totally skipped (just add the canvas to the Outer ScaleBox directly) and the issue will still be shown, although the scaleboxes will make it a bit of chaotic (the text box will still be cut even with ‘Size to Content’ but the font will be very, very big). However, without the sizebox the issue is much easily visible.

"Some Text:"

This time there is no several ways, only one right way to reproduce:

  1. Make a clean, blank project, no starter content, 4.8.3 binary build.
  2. Create a new widget, based on standard parent - UserWidget by right clicking in the content and going ‘User Interface’ → ‘Widget Blueprint’
  3. Delete the existing Canvas Panel
  4. Add a ScaleBox (let’s call it Outer)
  5. Set the ‘Stretch’ option in the details panel of the Outer ScaleBox to ‘Fill’
  6. Add Canvas Panel as a child of the Outer ScaleBox (step 4)
  7. Add a second ScaleBox as a child of the Canvas Panel from step 6. Let’s call this ScaleBox Inner.
  8. Change these properties of the Inner ScaleBox:

Anchors: Center-Center (you can copy this and paste right-clicking on ‘Anchors’ as well): (Minimum=(X=0.500000,Y=0.500000),Maximum=(X=0.500000,Y=0.500000))

PositionX: -800
PositionY: -550
SizeX: 1600
SizeY: 1100

9 Add a second Canvas Panel as a child of the Inner Scale Box from step 7

10 Add an Image as a child of the second Canvas panel from step 9

11 Change these properties of the Image:

PositionY: 457
SizeX: 1221
SizeY: 820

12 Add a TextBlock as another child of the second canvas panel from step 9.

13 Change the SizeX of the TextBlock to 550

14 In the details tab of the TextBlock, under ‘Appearance’ find ‘Justification’ and select the third option (called ‘AlignTextRight’, but it’s an icon, just like in every Word-like software)

15 Even the default font and text is already messed heavily - half is cut.

As far as I can tell, it’s the ScaleBox that messes stuff up. Thing is, if you want to do UMG for all the resolutions, or you’re making a widget to be used as a button that may be scaled on many other menu pages in tons of different ways, then you need to use them, sometimes even nest two (one for whole page to fill the screen, second for the text blocks, to scale to fit the fontsize to the place that they received from their parents, ie. Horizontal box).

If there is anything more you need, or something is not as easy to understand as I’d wish, I’ll gladly reply and provide more information. We just really need this fixed. Thank you for your quick reply.

I’ve had to split the comments, because of the limit. Hope it’s not too much of an issue.

Hello

I was able to reproduce the issue with the “some text” example and I have written up a report (UE-24117) that has been submitted to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. As for the issue with the incorrect clipping in the “TextBlock” example, I found that this is a known (UE-17037) issue and I have provide a link to the original issue below. Please visit that link for future updates on UE-17037.

Link to UE-17037: [UMG] Errors with text rendering? - UI - Epic Developer Community Forums

Make it a great day

Hi Rudy,
have you got any news about UE-24117 and UE-17037?

Regards

Pierdek

Hello Pierdek,

I went ahead and double checked on these issue for you and I have posted my findings below. I hope that this information helps.

UE-24117 Update: This have been resolved internally and it will be available in a later release of the engine.

UE-17037 Update: This issues status has not been updated to fixed as of yet. However, I will be sure to bump up the community interest on the report for you.

Make it a great day

Hi again,
please ask someone responsible for UE-24117 where in the source code is the fix for this issue, finding fix on my own is extremaly hard especially without separated github commits and comments with jira identifiers.

Thanks in advance.

The developers aren’t sure about the exact change list that resolved the issue, but it no longer reproduces after other changes were made. I will be unable to provide a commit because of this. However, This solution is currently projected for a 4.11 release (this is not a guarantee, only an estimate).