※現在、「wonderfl build flash online」求人コンテンツ制作に関してのアンケートを実施中です!みなさまのお力添えを頂いて、続々とアンケート結果が集まっていますが、まだまだ募集しております。ご協力のほど、どうぞよろしくお願いいたします!
wonderfl運営事務局
→アンケートページ(※ログインしてからお答えいただけるようになっています。)
fonttext
Font Listing forked from: Font Listing
- // forked from mtok's Font Listing
- package
- {
- import flash.events.Event;
- import flash.display.LoaderInfo;
- import flash.display.Loader;
- import flash.display.Sprite;
- import flash.net.URLRequest;
- import flash.text.Font;
- import flash.text.TextField;
- import flash.text.TextFormat;
- import flash.text.TextFieldAutoSize;
- /**
- * ...
- * @author DefaultUser (Tools -> Custom Arguments...)
- */
- [SWF(width = "465", height = "465", frameRate = "0", backgroundColor = "#FFFFFF")]
- public class FontListing extends Sprite
- {
- private var _textField:TextField;
- public function FontListing()
- {
- _textField = new TextField();
- _textField.x = 10;
- _textField.y = 10;
- _textField.width = stage.stageWidth;
- _textField.height = stage.stageHeight;
- _textField.multiline = true;
- addChild(_textField);
- init();
- }
- private function init():void {
- var fontArray:Array = Font.enumerateFonts(true);
- fontArray.forEach(traceElement);
- }
- private function traceElement(element:*, index:int, ary:Array):void {
- var f:Font = element as Font;
- var begin:int;
- var end:int;
- var msg:String = "";
- msg += "index:" + index + " fontName:" + f.fontName
- + " fontType:" + f.fontType + " fontStyle:" + f.fontStyle + "\n";
- begin = _textField.text.length - 1;
- _textField.appendText(msg);
- end = _textField.text.length - 1;
- _textField.setTextFormat(new TextFormat(f.fontName, 20), begin, end);
- //trace(msg);
- }
- }
- }
Font Listing forked from: Font Loading
- package
- {
- import flash.system.LoaderContext;
- import flash.system.Security;
- import flash.events.ProgressEvent;
- import flash.events.Event;
- import flash.display.LoaderInfo;
- import flash.display.Loader;
- import flash.display.Sprite;
- import flash.net.URLRequest;
- import flash.text.Font;
- import flash.text.TextField;
- import flash.text.TextFormat;
- import flash.text.TextFieldAutoSize;
- import flash.utils.getQualifiedClassName;
- /**
- * ...
- * @author DefaultUser (Tools -> Custom Arguments...)
- */
- [SWF(width = "465", height = "465", frameRate = "0", backgroundColor = "#FFFFFF")]
- public class FontLoading extends Sprite
- {
- private var _textField:TextField;
- public function FontLoading()
- {
- Security.loadPolicyFile('http://www.matzmtok.com/wonderfl/crossdomain.xml');
- var loader:Loader = new Loader();
- var url:String = "http://www.matzmtok.com/wonderfl/fonts.swf";
- var req:URLRequest = new URLRequest(url);
- loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
- loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
- loader.load(req);
- _textField = new TextField();
- _textField.x = 10;
- _textField.y = 10;
- _textField.width = stage.stageWidth - 20;
- _textField.height = stage.stageHeight - 20;
- _textField.multiline = true;
- addChild(_textField);
- }
- private function progressHandler(e:ProgressEvent):void
- {
- var percent:Number = e.bytesLoaded / e.bytesLoaded;
- _textField.appendText("loading...." + Math.round(100 * percent) + "\n");
- }
- private function completeHandler(e:Event):void
- {
- _textField.appendText('loading complete\n');
- var li:LoaderInfo = e.target as LoaderInfo;
- var fasset:Class =
- li.applicationDomain.getDefinition('FontAsset') as Class;
- _textField.appendText(getQualifiedClassName(fasset) + "\n");
- _textField.appendText(getQualifiedClassName(fasset.oxygen));
- Font.registerFont(fasset.oxygene);
- Font.registerFont(fasset.firestar);
- Font.registerFont(fasset.MacType);
- init();
- }
- private function init():void {
- var fontArray:Array = Font.enumerateFonts();
- fontArray.forEach(traceElement);
- }
- private function traceElement(element:*, index:int, ary:Array):void {
- var f:Font = element as Font;
- var msg:String = "";
- msg += "index:" + index + " fontName:" + f.fontName
- + " fontType:" + f.fontType + " fontStyle:" + f.fontStyle + "\n";
- _textField.appendText(msg);
- }
- }
- }
notice: 

