Created
February 16, 2011 18:50
-
-
Save benbjohnson/829908 to your computer and use it in GitHub Desktop.
Flex vs AS3 Font Embedding
This file contains 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
package | |
{ | |
import flash.text.Font; | |
// This will not generate any ActionScript! | |
[Embed(source="MyFont.otf", fontFamily="myFont", mimeType='application/x-font')] | |
public class MyFont extends Font | |
{ | |
public function MyFont() | |
{ | |
super(); | |
} | |
} | |
} |
This file contains 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
package | |
{ | |
public class MyFlexFont | |
{ | |
[Embed(source="MyFont.otf", fontFamily="myFont", mimeType='application/x-font')] | |
private var myFont:Class; | |
} | |
} |
This file contains 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
package | |
{ | |
import mx.core.FontAsset; | |
[ExcludeClass] | |
[Embed(_resolvedSource="/private/tmp/font/MyFont.otf", _column="3", source="MyFont.otf", exportSymbol="MyFlexFont_myFont", _line="5", fontFamily="myFont", _file="/private/tmp/font/MyFlexFont.as", mimeType="application/x-font")] | |
public class MyFlexFont_myFont extends mx.core.FontAsset | |
{ | |
public function MyFlexFont_myFont() | |
{ | |
super(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment