2012-03-24 36 views
0

我试过在前面添加/,就像其他许多论坛和博客所建议的那样,并没有奏效。AS3 with alivePDF嵌入字体 - 无法转码.afm

我希望我错过了一些东西,你们可以帮我抓住它。我使用的是AlivePDF库及其工作正常至今到现在为止,我试图嵌入swiss-721-bold-outline,这里是我的代码:

[Embed(source="/../swissFonts/swz721bo.TTF", mimeType="application/octet-stream")] 
     var swissBold:Class; 

[Embed(source="/../swissFonts/swiz721bo.afm", mimeType="application/octet-stream")] 
     var BoldAfm:Class; 

var regularSwiss:EmbeddedFont = new EmbeddedFont(new swissBold() as ByteArray, new BoldAfm() as ByteArray, CodePage.CP1252); 

很简单,但我不断收到这些错误:

Unable to resolve '/../swissFonts/swiz721bo.afm' for transcoding 
Unable to transcode /../swissFonts/swiz721bo.afm. 

请注意,.TTF文件没有错误,只是.afm ...

回答

0

您需要指定fontName。

[Embed(source="/../swissFonts/swz721bo.TTF",fontName="swz721bo",mimeType="application/octet-stream")] 
var swissBold:Class; 
0

我有同样的错误:

flex air Assets.as(34): Error: exception during transcoding:
Error: unable to build font 'FontName'

为了解决它,我加入这一行:

-managers flash.fonts.AFEFontManager 

项目属性>编译器选项>高级编译器选项