Widget Genius Required! - Multiple lines of text in a block

Hi,

I’m trying to perform a reasonably simple task with text. Say my text is:

THIS IS THE
BIG IDEA
I WANT THESE LINES TO SCALE TO A WIDTH

I just want to get these to line up by altering the scale of the font - so ‘BIG IDEA’ would be in a larger font and ‘I WANT THESE LINES TO SCALE TO A WITH’ would be a lot smaller.

I can kind of do this using the vertical container in UMG but I can’t get it to do the leading correctly.

At the moment i’ve got it running by iteration with the RenderTextComponent in an actor blueprint - it fiddles the font size up and down per line until it’s the right width - then grabs the font height and goes onto the next line. This is not ideal as the leading isn’t always right if there are funny characters and the offline rather than runtime fonts are a bit rubbish looking.

I want to do this in UMG and i’m happy to have many widget components rather than try to ram them into a vertical container but I can’t work out if it’s possible to get the dimensions of the widget (to the edges of the text).

Any help here would be much appreciated.

Dan

<VerticalBox>
<ScaleBox>
<Text>THIS IS THE</Text>
</ScaleBox>
<ScaleBox>
<Text>BIG IDEA</Text>
</ScaleBox>
<ScaleBox>
<Text>I WANT THESE LINES TO SCALE TO A WIDTH</Text>
</ScaleBox>
</VerticalBox>

Thanks Nick, i’ll give that a go but it looks to be very much like my earlier attempt - The row’s widths work out fine but it’s the leading or spacing between the rows which don’t work. Depending on the font you get huge variation between the default spacing and I don’t think UMG can do it. What I could do with is being able to find out what the point size of the text has become following being scaled in the scale box, then adjusting the height offset of each line in a more controlled way.