Skip to content

Instantly share code, notes, and snippets.

@wouterds
Created December 17, 2012 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wouterds/4316802 to your computer and use it in GitHub Desktop.
Save wouterds/4316802 to your computer and use it in GitHub Desktop.
Font embedding
// Embedding
[Embed(source="/../media/fonts/DINPro-Medium.otf", embedAsCFF="false", fontFamily="DinProMedium")]
public static const DinProMedium:Class;
[Embed(source="/../media/fonts/OpenSans-Regular.ttf", embedAsCFF="false", fontFamily="OpenSansRegular")]
public static const OpenSansRegular:Class;
[Embed(source="/../media/fonts/OpenSans-Semibold.ttf", embedAsCFF="false", fontFamily="OpenSansSemibold")]
// Usage
Config.OpenSansRegular;
var textfield:TextField = new TextField(Starling.current.stage.stageWidth - Config.ContentOffset * 2, Starling.current.stage.stageHeight, textElementVO.text, "OpenSansRegular", Config.NormalTextSize, Config.NormalTextColor);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment