flex 字体加载方式3
?flex 加载方式3:通过actionScript加载,通过loader加载字体然后调用getDefinitionByName()获得字体Class,注册字体后,就可以用了。
?
?
package{import flash.display.Sprite;public class FontAssets extends Sprite{ [Embed(source="font/AlphaFitness.ttf",fontName="zhzFont1",mimeType="application/x-font")] public var pixelFont1:Class; [Embed(source="font/WeibeiFont.ttf",fontName="zhzFont2",mimeType="application/x-font")] public var pixelFont2:Class; [Embed(source="font/WindTailsFont.ttf",fontName="zhzFont3",mimeType="application/x-font")] public var pixelFont3:Class; [Embed(source="font/YayaSimplifiedFont.ttf",fontName="zhzFont4",mimeType="application/x-font")] public var pixelFont4:Class; [Embed(source="font/YegenyouSimplifiedFont.ttf",fontName="zhzFont5",mimeType="application/x-font")] public var pixelFont5:Class;}}?
?