HOWTO - embed fonts from a SWF into a Flex app

flexfontembed_20070503.jpg

I haven't done any coding in Flex yet, but I came across this howto today that illustrates how simple it is to pull in a Flash SWF that has an embedded font and use it within the Flex application. Embedding the bold, italic, and bold-italic sets for a font allows you to use the standard <b> and <i> tags in an htmlText element that is using the embedded font.

As an aside, it appears that Flex even allows you to do a rotation on the text even when it's not using a standard system font. This is something that was a total pain with embedded fonts in Flash/AS2, requiring rendering the text on the fly as a bitmap and then rotating the bitmap version. Major headache.

I'm pretty excited to see that text effects like this have become so simple to achieve. Now, if only someone could figure out how to lighten the file size when you're trying to embed a traditional Chinese character set.

Embedding fonts from a Flash SWF file into a Flex application

Posted by Jason Striegel | May 2, 2008 11:39 PM
Flash | Permalink | Comments (1) Bookmark and Share

Recent Entries

Comments

Newest comments listed first.

Posted by: Keith on May 4, 2008 at 12:11 AM

try limiting the character range

limit the character range to decrease the file size:

http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_07.html


Leave a comment



Bloggers

Welcome to the Hacks Blog!

Brian Jepson.Brian Jepson


Jason Striegel.Jason Striegel


Philip Torrone.Phillip Torrone



See all of the books in the Hacks Series!
Advertise here.

Recent Posts

www.flickr.com
photos in Hacks More photos in Hacks