as3中怎么设置嵌入字体
as3中如何设置嵌入字体
代码如下
代码如下
public static function setEmbedFontsTextFormat(size:Object, color:Object, bold:Object, font:String = EMBEDED_FONT_NAME):TextFormat { var textFormat:TextFormat = new TextFormat(); textFormat.size = size; textFormat.bold = bold; textFormat.color = color; var c:Class = getDefinitionByName(font) as Class;//来自字体库,嵌入字体 Font.registerFont(c); var myFont:Font = new c as Font; textFormat.font = myFont.fontName; return textFormat; }