当前位置: 代码迷 >> Web前端 >> as3中怎么设置嵌入字体
  详细解决方案

as3中怎么设置嵌入字体

热度:103   发布时间:2012-08-27 21:21:56.0
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;

		}
  相关解决方案