Posted By

NeekGerd on 03/01/11


Tagged

embed font fonts embeded


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

withinmedianl
onemanstudio
adrianparr
jhshie


Embed Font in FlashBuilder Project


 / Published in: ActionScript 3
 

URL: http://forums.adobe.com/message/3276591#3276591

How to embed a font in a Flash Builder 4* project?

  1. package
  2. {
  3. import flash.display.MovieClip;
  4. import flash.text.*;
  5.  
  6. public class QuickTest extends MovieClip
  7. {
  8.  
  9. // Embed the font Verdana
  10. [Embed(source="c:/windows/fonts/verdana.ttf", fontFamily="Verdana", embedAsCFF="false")]
  11. private var verdana:Class;
  12.  
  13. public function QuickTest ()
  14. {
  15. // Set the font with a TextFormat object
  16. var format:TextFormat = new TextFormat( );
  17. format.font = "Verdana";
  18. format.size = 56;
  19.  
  20. var t:TextField = new TextField( );
  21. t.embedFonts = true;
  22. // Format text using the font Verdana
  23. t.defaultTextFormat = format;
  24. t.text = "hello world";
  25. addChild(t);
  26. }
  27. }
  28. }

Report this snippet  

You need to login to post a comment.