Flex嵌入字体错误

在flex嵌入本地字体调用如下语句:

[Embed(systemFont='Arial', fontName='spArial', mimeType='application/x-font')]
  public static var ArialFont:Class;

时出现错误。错误提示如下:

此行的多个标记:
-转换代码时出现意外错误:Cannot embed local font 'Arial' 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.
-无法构建字体“spArial”

解决方案:

在嵌入字体时加入如下标签:embedAsCFF="false",

最后采用如下方式加载字体:

[Embed(systemFont='Arial', embedAsCFF="false", fontName='spArial',mimeType='application/x-font')]
  public static var ArialFont:Class;

你可能感兴趣的:(Java(Flex,常用框架,等等))