forked from: FontLoaderを使ってMinimalCompsで日本語表示
/**
* Copyright bkzen ( http://wonderfl.net/user/bkzen )
* GNU General Public License, v3 ( http://www.gnu.org/licenses/quick-guide-gplv3.html )
* Downloaded from: http://wonderfl.net/c/wpoW
*/
// forked from Fake's FontLoaderを使ってMinimalCompsで日本語表示
package {
import flash.text.TextFormat;
import flash.events.Event;
import flash.display.Sprite;
import com.bit101.components.Text;
import net.wonderfl.utils.FontLoader;
import com.bit101.components.Style;
import com.bit101.components.PushButton;
public class FlashTest extends Sprite {
private var fontname:String = "Cinecaption";
private var debugout:Text;
public function FlashTest() {
// write as3 code here..
debugout = new Text(this, 50, 50, "Now loading...");
var floader:FontLoader = new FontLoader();
floader.addEventListener(Event.COMPLETE, function (e:Event):void {
debugout.textField.defaultTextFormat = new TextFormat(fontname, 12);
debugout.text = "こんなやり方で大丈夫か?\n";
//Style.embedFonts = false;
Style.fontName = fontname
Style.fontSize = 12;
var btn:PushButton = new PushButton(parent, 50, 180, "大丈夫だ、問題ない");
btn.setSize(150, 20);
var btn2:PushButton = new PushButton(parent, 50, 220, "一番いいフォントを頼む");
btn2.setSize(150, 20);
});
floader.load(fontname);
}
}
}