Skip to content

Instantly share code, notes, and snippets.

@wwwins
Created February 15, 2012 06:25
Show Gist options
  • Save wwwins/1833759 to your computer and use it in GitHub Desktop.
Save wwwins/1833759 to your computer and use it in GitHub Desktop.
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.text.Font;
/**
* 注意 document main class 不要用 main 會跟 loader main class 打架
*/
public class MainFont extends Sprite
{
[Embed(source = "ctb_wt024.ttf", fontName = "FontName", unicodeRange = "U+31,U+32,U+33,U+34,U+35,U+36,U+37,U+38,U+39,U+30,U+52c7,U+6562,U+8ffd,U+9010,U+81ea,U+5df1,U+7684,U+5922,U+548c,U+8272,U+5f69", mimeType = "application/x-font-truetype", embedAsCFF="false")]
public var FontClass:Class;
public function MainFont():void
{
Font.registerFont(FontClass);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment