You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Federico De Maddalena <f....@patente.it> on 2013/06/03 15:27:35 UTC

Size label font size to fit container

Hi!
is there an easy way to resize text of a spark label to fit container
size?

E.g.
<s:VGroup height="10%" width="100%">
	<s:Label width="100" text="...a long text..." id="label">
</s:VGroup >

I would set dynamically label fontSize, depending to label.text lenght.
TY
Federico

Re: Size label font size to fit container

Posted by Alex Harui <ah...@adobe.com>.
If you want to change fontSize so text fits some other size, you'd
probably have to test various fontSize values to find the right fit.

If you don't mind some visual degradation, you might be able to scale the
Label to fit.

On 6/3/13 6:27 AM, "Federico De Maddalena" <f....@patente.it>
wrote:

>
>Hi!
>is there an easy way to resize text of a spark label to fit container
>size?
>
>E.g.
><s:VGroup height="10%" width="100%">
>	<s:Label width="100" text="...a long text..." id="label">
></s:VGroup >
>
>I would set dynamically label fontSize, depending to label.text lenght.
>TY
>Federico