Posted By

quan on 01/11/10


Tagged

embed font


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Demian
adrianparr


embed font


 / Published in: ActionScript 3
 

  1. /*
  2.  
  3. U+0052-U+007A Lowercase a-z
  4. U+0030-U+0039, 0-9
  5. U+0041-U+0051,Uppercase A-Z
  6.  
  7. all Latin I characters
  8. U+0020-U+002F,U+0030-U+0039,U+003A-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E
  9. */
  10.  
  11. [Embed(systemFont = "Franklin Gothic Heavy",
  12. fontName = "FranklinGothicHeavy",
  13. mimeType = "application/x-font",
  14. unicodeRange = "U+0020-U+002F,U+0030-U+0039,U+003A-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E")]
  15.  
  16. var FranklinGothicHeavy : Class;
  17.  
  18. Font.registerFont(FranklinGothicHeavy);
  19.  
  20. /*
  21.  * Get all the embedded fonts
  22.  */
  23.  
  24. var fontArray:Array = Font.enumerateFonts(false);
  25. for(var i:int = 0; i < fontArray.length; i++) {
  26. var thisFont:Font = fontArray[i];
  27. trace(name: “ + thisFont.fontName);
  28. trace(“typeface: “ + thisFont.fontStyle);
  29. }

Report this snippet   <

You need to login to post a comment.