Thanks Josh, thats a perfect match. The

mode == SIZE_MODE_FIT_TO_BOUNDS_WITHOUT_BREAKS
is indeed very nice.

So far, my method works, because I can use ratios, but should i need
something more robust, I'll definitely dig that code

mika

On Tue, Apr 6, 2010 at 19:57, Josh Saxe <[email protected]> wrote:
>
> Yeah, same experience here.  This piece of code may help you:
>
> http://code.google.com/p/flex2treemap/source/browse/trunk/source/com/flextoolbox/utils/FlexFontUtil.as?spec=svn131&r=131
>
> Josh
>
>
>
> ________________________________
> From: Glen Pike <[email protected]>
> To: Flash Coders List <[email protected]>
> Sent: Tue, April 6, 2010 10:06:45 AM
> Subject: Re: [Flashcoders] Adapt textfield font to textfield size
>
> Hi,
>
>    I had to do something similar - loop down the size until it fits :(
> Sorry, no joy here...
>
>    Glen
>
> mika wrote:
> > Hi,
> >
> > I am creating textfields in zones with differents width and heights. The
> > content of textfiels depends on user input.
> > I'd like to change the font size of the textfield so that the text is fully
> > displayed (using wordwrap=true and autoSize)
> >
> > I could imagine a testing loop that decreases  textfield font until it has
> > appropriate size, but that sounds rather nasty.
> >
> > Anyone can think of a cleaner approach ? This is AS3
> >
> > Thanks
> > _______________________________________________
> > Flashcoders mailing list
> > [email protected]
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> >
>
> --
>
> Glen Pike
> 01326 218440
> www.glenpike.co.uk<http://www.glenpike.co.uk>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>
>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to