Skip to content

Instantly share code, notes, and snippets.

@RKAN
Created July 21, 2013 06:36
Show Gist options
  • Save RKAN/6047723 to your computer and use it in GitHub Desktop.
Save RKAN/6047723 to your computer and use it in GitHub Desktop.
Font embedding Font embedding and prevention of anti aliasing which is good for bitmap fonts:
//Embedding the font:
[Embed(source="FONT.ttf", fontName = "myFont", mimeType = "application/x-font-truetype", advancedAntiAliasing="true", embedAsCFF="false")]
private var myEmbeddedFont:Class;
//Creating the textformat:
var defaultTextFormat : TextFormat = new TextFormat('myFont');
//Applying the font to a textfield:
myTextField.defaultTextFormat = Config.defaultTextFormat;
myTextField.embedFonts = true;
//These two next lines prevent anti aliasing - good for bitmap fonts:
myTextField.antiAliasType = AntiAliasType.ADVANCED;
myTextField.sharpness = 400;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment