In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

システムフォントの埋め込み

システムフォントの埋め込み
* @author OKI Yoshiya (ceroan)
Get Adobe Flash player
by 448jp 22 Jun 2009
    Embed
/**
 * Copyright 448jp ( http://wonderfl.net/user/448jp )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/9bg8
 */

/**
 * システムフォントの埋め込み
 * @author OKI Yoshiya (ceroan)
 */
package {
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.*;
	
	public class Main extends Sprite {
		
		[Embed(systemFont = "sansserif", fontName = "fSansSerif", mimeType = "application/x-font")]
		private var myFont:Class;
		
		public function Main() {
			var t:TextField = new TextField();
			t.autoSize = TextFieldAutoSize.LEFT;
			t.embedFonts = true;
			var tf:TextFormat = new TextFormat();
			tf.font = "fSansSerif";
			tf.size = 24;
			t.defaultTextFormat = tf;
			t.text = "This SWF embed Sans-Serif.";
			t.appendText("\n日本語は表示されません。");
			t.appendText("\nJapanese isn't display.");
			t.appendText("\n英語フォントしか埋め込んでないからね。");
			t.appendText("\nBecause only English font is embed.");
			addChild(t);
		}
		
	}
}