Embed Font in FlashBuilder Project


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

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


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

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.