Tuesday, May 9, 2006
Using FlashType in Flex 2 Beta 3
Flex 2 Beta 3 provides an easy way to use the improved FlashType font rendering for embedded fonts inside your Flex 2 application.
Currently, the Flex 2 compiler is not capable of creating FlashType fonts for you - instead, you'll have to create a Flash 8 SWF file that embeds the according font. Then, inside your Flex 2 CSS definition, you embed the font as you did before, but refer to the SWF file instead a TTF file. Here's a little demo that shows the difference between the default font embedding and a FlashType font (Flash Player 9 beta 3 required). While the upper Labels appear very blurry, the Labels on the bottom appear very crisp and clear.
Dirk.
Comments
Hi,
I can't get it to work... Can you please publish your source code?
If I try the following as3 code in Flex beta 3 I always get a compiler error:
[Embed(source="2.swf", fontName="Verdana")] public var fontBold:Class;
Error: The definition of base class FonteAsset was not found.
(Used to work in Flex beta2.)
Hmmm... can you help?
Lorenz
Posted By lorenz / Posted At 5/11/06 3:38 PM
Hi Lorenz,
you'll have to add the framework.swc file to your projects build path (in Flex Builder 2 go to the project properties, choose ActionScript Build Path --> Library Path --> Add SWC... and locate the framwork.swc, e.g. D:\Programme\Adobe\Flex Builder 2.0 Plug-in Beta 3\Flex SDK 2.0\frameworks\libs\framework.swc)
Dirk.
Posted By Dirk / Posted At 5/11/06 3:50 PM
Hi Dirk,
thanks a lot!!!
Now it's working fine. I can either include an swf or ttf file.
The rendered text looks much cripser and sharper if you use an swf file.
Greetings,
Lorenz
Posted By Lorenz / Posted At 5/12/06 7:43 AM