Created
July 21, 2013 06:36
-
-
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:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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