0

I've tried adding the / at the front like many other forums and blogs suggested and that didnt work.

I'm hoping I missed something, and you guys can help me catch it. I'm using the AlivePDF library its working fine so far until now, I am trying to embed the swiss-721-bold-outline, here is my code:

[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);

Simple, but I keep getting these errors:

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

Notice that the .TTF file has no errors, just the .afm ...

António Almeida
  • 9,620
  • 8
  • 59
  • 66
Uri
  • 1
  • 2

3 Answers3

0

Is the afm file using the cp1252 map? This tool is mentioned for encoding afm files from ttf http://fpdf.fruit-lab.de/index.php

Lex
  • 4,749
  • 3
  • 45
  • 66
0

You need to specify fontName.

[Embed(source="/../swissFonts/swz721bo.TTF",fontName="swz721bo",mimeType="application/octet-stream")]
var swissBold:Class;
Francisc
  • 77,430
  • 63
  • 180
  • 276
0

I was having the same error:

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

To solve it I added this line:

-managers flash.fonts.AFEFontManager

to Project Properties > Compiler Options > Advanced Compiler Options

António Almeida
  • 9,620
  • 8
  • 59
  • 66