Development March 6, 2010 @ 09:16

Embedding Fonts in Flash Builder 4

Normally in as3 I would do it like this:

[Embed(source="fontFile.ttf", fontName="MyFontName")]
private var MyFont:Class;
public var myTextFormat:TextFormat = new TextFormat("MyFontName");

But for some reason (I currently don’t care about), in Flex 4, the text doesn’t show up. So after some searching some forums, I found the solution: add embedAsCFF=false to the Embed tag. Because a TTF font in a TextField is not a CFF? Oh well..

[Embed(source="fontFile.ttf", fontName="MyFontName", embedAsCFF=false)]
public var MyFontClass:Class;
public var myTextFormat:TextFormat = new TextFormat("MyFontName");

Currently Flash Builder 4 is still in development, so this could change in the future.
This is still the case in the release version.

Development March 4, 2010 @ 15:51

Simple AStar in AS3

For those looking for my astar implementation in as3, here’s the link to baseoneaslib so you can still access it. Sorry! I lost my old blog while moving to another host!