For what it's worth, if you have a registered copy of the charting
components, there's a class that does essentially what jon is
describing:

 

mx.charts.chartClasses.ChartLabel.

 

It's what the charts use for axis titles. It uses native font rendering
if the font is embedded or if the label's composite transform is
unscaled and unrotated, or blits the text field into a bitmap for
display otherwise.

 

(You'll get higher quality rendering if you avoid the bitmap issue,
since blitting into a bitmap turns off sub pixel antialiasing, so it's
best to avoid that code path whenever possible).

 

Ely.

 

 

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jon Bradley
Sent: Friday, August 31, 2007 10:18 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] addChild to UITextField?

 

Tony,

Check out my last post titled "Techniques for rotating non-embedded 
fonts". I detailed a bit more of the solution and included parts of a 
setTransform method that breaks up the processes. My draw method for 
the text is pretty straightforward - draw the text field into a 
bitmap (but make sure it's visible, then draw, then invisible).

The hardest part to all this will be dealing with the runtime CSS and 
font loading, if you want to use that in conjunction with device 
fonts. Right now I have a FontCollection model that stores are loaded 
and device fonts in a list (separate VOs for each). The UIComponent 
does the heavy lifting here.

Also, you may run into issues with the antialias property warnings - 
regenerateStyleCache(false) will be your friend here.

good luck,

jon

On Aug 31, 2007, at 11:53 AM, Tony Alves wrote:

> Jon,
> Any way we can see the code on the way you did this? I have a need 
> for
> it, but it is on the back burner for now. Any insight would be a 
> world
> of help.
>
> Thanks for any insight,
> Tony
>
> Jon Bradley wrote:
>>
>> Thanks for all your help on this guys. I finally figured it all out.
>> Jeez - took long enough. Now I just have to optimize it a bit.
>>
>>
>> The end solution was to wrap it in UIComponent (dumb style
>> propagation). UIComponent is just beefy and way more than I need for
>> this, but it works so I'll live with it for now.
>>
>> All the work was worth it though, I have a relatively high quality
>> bitmap representation of text that can be rotated, scaled realtime by
>> an end user and I don't have to load a dang font to do it. Finally.
>>
>> rock on!
>>
>> - jon
>>
>>
>>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%
<http://www.mail-archive.com/flexcoders%25>  
> 40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>

 

<<image001.jpg>>

<<image002.jpg>>

Reply via email to