Return to Snippet

Revision: 26170
at April 19, 2010 13:44 by adrianparr


Initial Code
import flash.text.TextField;
import flash.text.TextFormat;

[Embed(source="your_font_file_name", fontName="font_name_temp", mimeType="application/x-font")]
public static const FONT_NAME_TEMP_FONT:Class;

// create a new TextField
var tf_tmp:TextField = new TextField();

// don't forget this one
tf_tmp.embedFonts = true;

// and finally, just use the font name you specified earlier
tf_tmp.defaultTextFormat = new TextFormat("font_name_temp", 8, 0xFFFFFF);

Initial URL
http://blog.open-design.be/2008/05/27/embed-a-font-in-as3-with-the-flex-sdk/

Initial Description
Thanks to Thomas John.

Initial Title
AS3 Embed a font in with the flex SDK

Initial Tags
Flex

Initial Language
ActionScript 3