Posted By

adrianparr on 04/19/10


Tagged

embed MIMEtype TextField Flex as3 fonts source SDK TextFormat fontName defaultTextFormat


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

thastylos
tspitzr
scottwatkins


AS3 Embed a font in with the flex SDK


 / Published in: ActionScript 3
 

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

Thanks to Thomas John.

  1. import flash.text.TextField;
  2. import flash.text.TextFormat;
  3.  
  4. [Embed(source="your_font_file_name", fontName="font_name_temp", mimeType="application/x-font")]
  5. public static const FONT_NAME_TEMP_FONT:Class;
  6.  
  7. // create a new TextField
  8. var tf_tmp:TextField = new TextField();
  9.  
  10. // don't forget this one
  11. tf_tmp.embedFonts = true;
  12.  
  13. // and finally, just use the font name you specified earlier
  14. tf_tmp.defaultTextFormat = new TextFormat("font_name_temp", 8, 0xFFFFFF);

Report this snippet  

You need to login to post a comment.