Skip to content

Instantly share code, notes, and snippets.

@benbjohnson
Created February 16, 2011 18:50
Show Gist options
  • Save benbjohnson/829908 to your computer and use it in GitHub Desktop.
Save benbjohnson/829908 to your computer and use it in GitHub Desktop.
Flex vs AS3 Font Embedding
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();
}
}
}
package
{
public class MyFlexFont
{
[Embed(source="MyFont.otf", fontFamily="myFont", mimeType='application/x-font')]
private var myFont:Class;
}
}
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