现在的位置: 首页 > 综合 > 正文

Flex4中关于无法构建字体错误

2013年10月12日 ⁄ 综合 ⁄ 共 605字 ⁄ 字号 评论关闭

 

在Flex4中做一个项目,出现一个错误烦恼了一段时间,

代码是这样的:

[Embed(systemFont="宋体",
                fontName="myFont",
                mimeType="application/x-font")]

 提示错误:

无法构建字体“myFont”

转换代码时出现意外错误:Cannot embed local font '宋体' as CFF. The CSS @font-face 'local()' syntax is not supported. Please specify a path directly to a font file using the 'url()' syntax. For [Embed] syntax the 'systemFont' attribute is not supported. Please specify
a path directly to a font file using the 'source' attribute.

 

通过一个网友的帮助,原来那是flex3中的方法,flex4中发生了变化

 

改过后的代码:

[Embed(systemFont="宋体",
		        fontName="myFont5",
				mimeType="application/x-font-truetype",
				embedAsCFF="false" )]

 

flex4中需要加上

mimeType="application/x-font-truetype" 
 embedAsCFF="false" 

抱歉!评论已关闭.