AlecMcE.com

Coding on the Flash Platform

Enhanced Text in as3

View Comments

A recent development in the Flash community has been to use the exposed ByteData information to parse font glyphs into curves and to render text by rendering the curves. Inevitably this leads to higher memory overhead for the application, but the payoff is that rendering text no longer requires the painful TextField class.

Guojian Miguel Wu has written the swfvector library, which does the job of stripping out font data that has been embedded into a swf with the Flash IDE. Unfortunately I’m not a fan of it as library code: classes called Color, Data and so on are very quickly likely to become confused with other libraries’ code, while the main class is too unwieldy to be added into projects regularly.

I’ve taken the liberty of renaming his code and including it in my Enhanced Text project code.google.com/p/as3enhancedtext/, which seeks to piggy-back on the back of Wu’s work and to provide a simple API for the library to be implemented into projects. The project is ‘in progress’, but the first main class, EnhancedTextArea has reached its first working version.

<p>Example of the EnhancedTextArea class in action</p>

The font, loaded in at the top of the demo is capital-letters only. I’ll adjust this demo when I have time to offer multiple fonts; these should be easy to swap in and out.

Written by alec

July 21st, 2009 at 3:55 pm

Posted in as3, library

blog comments powered by Disqus