Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package
- {
- import flash.text.Font;
- import flash.display.Sprite;
- import flash.events.Event;
- [SWF(backgroundColor="#FFFFFF", frameRate="31", width="640", height="480")]
- public class Main extends Sprite
- {
- [ Embed( source="../bin/fonts/acmesai-webfont.ttf", embedAsCFF="false", fontFamily="Acme", mimeType="application/x-font-truetype" ) ]
- private var ACMESA:Class;
- public function Main()
- {
- super();
- addEventListener(Event.ADDED_TO_STAGE, start);
- }
- private function start(event : Event) : void
- {
- Font.registerFont(ACMESA);
- var allFonts:Array = Font.enumerateFonts(true);
- allFonts.sortOn("fontName", Array.CASEINSENSITIVE);
- var embeddedFonts:Array = Font.enumerateFonts(false);
- embeddedFonts.sortOn("fontName", Array.CASEINSENSITIVE);
- for each (var font : Font in embeddedFonts) {
- trace(font.fontName);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment