Textbox selection highlight doesn't respect margins/line height

I have an ‘Editable Text (Multi-line)’ box in a UMB widget for the player to enter notes.

When the margins are set to 0,0,0,0 with a line height percentage of 1, the text selection highlight appears correctly (see first image below).

122198-texthighlight1.png

However, if I change these values, the selection highlight doesn’t adjust to accommodate the new values. The next image shows the situation with margins at 0,-20,0,18 with a line height percentage of 0.7.

122199-texthighlight2.png

The font size is 18 in both cases.

I have to use these strange values (and I’m glad these settings are here in the first place) as I’m using a font that behaves a little oddly - note how in the first picture (with default line values), the ‘y’ is cut off at the bottom. The choice of font is an artistic one that I don’t really want to change just because of this bug, although it’s not a huge deal. The font is ‘Kozuka Gothic Pro’ (which downloadable anywhere on an open license if you need to test it).

Thanks!

Hello Bob3DGames,

I was able to reproduce this issue on our end. I have written up a report and I have submitted it to the developers for further consideration. I have provided a link to the public tracker. Please feel free to use the link provided for future updates.

Link: Unreal Engine Issues and Bug Tracker (UE-40673)

Make it a great day

Great, thanks!

I betcha the code assumes positive margins! :stuck_out_tongue:

Just to let you know that this highlight issue has been fixed for 4.16, and I’ve also added an option that lets you control whether the font layout uses the metrics or the bounding box to calculate the height, ascender, and descender.

In the case of the font you’re using here, the “bounding box” mode produces a more accurate line height, so you won’t need to work around it with margins.

Excellent, thanks!