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.
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?
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.
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.
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.