0

我已经尝试/像许多其他论坛和博客建议的那样在前面添加,但没有奏效。

我希望我错过了一些东西,你们可以帮我抓住它。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...

4

3 回答 3

0

您需要指定字体名称。

[Embed(source="/../swissFonts/swz721bo.TTF",fontName="swz721bo",mimeType="application/octet-stream")]
var swissBold:Class;
于 2012-06-10T22:03:32.370 回答
0

afm文件是用cp1252映射的吗?提到此工具用于编码来自 ttf http://fpdf.fruit-lab.de/index.php的 afm 文件

于 2012-04-26T09:34:12.887 回答
0

我遇到了同样的错误:

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

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

-managers flash.fonts.AFEFontManager

Project Properties> Compiler Options>Advanced Compiler Options

于 2014-03-19T10:43:47.527 回答