Posted By

shabith on 04/25/09


Tagged

embed font Flex as3 Fully


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

enajenkins
macKaminski
Pingpongbal
quan
tspitzr


Embedding fonts in AS3 on Flex 3


 / Published in: ActionScript 3
 

This describes how to embed font in to Flex(mxml) file without using the tag (fully AS3).

  1. [Embed(source='assets/CALIBRII.TTF', fontName='fontCalibri', fontStyle='italic', fontWeight='light', mimeType='application/x-font')]
  2.  
  3.  
  4. textFormat = new TextFormat();
  5. textFormat.color = 0xFFFFFF;
  6. textFormat.font = "fontCalibri";
  7. textFormat.size = 11;
  8.  
  9. textField = new TextField();
  10. textField.embedFonts = true;
  11. textField.text = "Embeded Text";
  12. textField.selectable = false;
  13. textField.background = true;
  14. textField.multiline = false;
  15. textField.backgroundColor = 0x000000;
  16. textField.setTextFormat(this.textFormat);

Report this snippet  

You need to login to post a comment.