Embed truetype font in FlashDevelop (Flex 4+)


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.