Posted By

coprolit on 09/07/10


Tagged

flash embed font TextField Flex 4 embedFonts flashdevelop truetype


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

shalomfriss
thastyle


Embed truetype font in FlashDevelop (Flex 4+)


 / Published in: ActionScript 3
 

  1. [Embed(source='C:/WINDOWS/Fonts/verdana.ttf', fontFamily="Verdana", fontWeight="regular", embedAsCFF="false")]
  2. public var Verdana:Class;
  3.  
  4. private var mytextfield:TextField = new TextField();
  5. private var mytextformat:TextFormat = new TextFormat();
  6.  
  7. /*
  8. ... class declaration ...
  9. */
  10.  
  11. mytextformat.font = "Verdana";
  12.  
  13. mytextfield.embedFonts = true;
  14. mytextfield.defaultTextFormat = mytextformat;

Report this snippet  

You need to login to post a comment.