Download

UMG/Text - Scaling text while allowing multiline - HELP

So I created a text component widget. Ultimately it is a single line of text (No wrap) that allows me to set a specified width and font size. If the text exceeds the width then the font is decreased to allow the text to fit.

I achieve this by:

[SizeBox] - Width override #
>[ScaleBox] -
>>[Text]

Now I want to do the same thing with a multi-line. So I created the same situation but I allow wrap and I test it and this works. I have to now have a width and height override so I can determine the max height of the text as well. When I increase the height, expectedly, the text increases in size. It is the scale box working properly. I guess what I ultimately need to do is set a max font size…I think.

So based on my situation and proposed resolution, that I can’t get working, I am wondering if anyone else has any other methods to solving this issue?

Not sure if it’ll help but you can use shift+enter (EOL,end of line, or enter key) on a normal text format.

Unfortunately that doesn’t get it done. Let me break it down better. I have a size box that has manual adjustments for Height and Width. This way I can drop my text widget on screen and work with it. Then I have a scale box that scales the size of the text if it gets too long. In this case the font will literally shrink as it fills the box that I have set explicit dimensions for.

I have this working with single line already. The issue is this, I need the words to wrap. Now this is easy to do in multiple ways but when you are adding wrapping against scaling, scaling always wins.

Ways I would do this if I were a coder could include setting a publicly editable variable per use that allows me to set a minimum scale or font size. Another way would be to make a variable for wrap width. This is also something that is controlled with a wrap box. But since I need this to be in BP I am having a hard time.

Wrap is not something I can easily control in BP.

TL-DR - I need to control the following:
-Height of text
-Width of text (Wrap should be set to this value)
-Min scale size

Purpose: Localized text sometimes exceeds my allotted text space and I want the wrap and scale to work together to reduce text down to the min scale size and no smaller - truncation would occur here but is permissible per my design.

Bump this is still a problem and it’s quite annoying.

Hi Cloel

The best way to do this, is Select your ‘Scale Box’ and in the Details Panel, make sure the ‘Stretch’ option is set to ‘Scale To Fit’ and ensure the option below that ‘Stretch Direction’ is set to ‘Down Only’.

This way, the text will only scale down and not up. So it will remain at the size you specify until it fits the whole Box and then will scale Down to fit more. So even if you made the size box bigger, it won’t scale up, it will keep it’s size.

You can then use the Vertical Alignment of the ‘Text’ up the top in Details to be set to Middle or Top etc depending on where you want your text displayed inside the scale box.

Hope this helps.

You can try set “Wrap Text At” parameter of “Text” widget component to need value and it fixes problems with scaling of wrapped text.
Tormented myself with this.
:cool: