Skip to main content
Inspiring
July 14, 2015
Question

AFEFontManager in Adobe AIR 18 . How to embed fonts now?

  • July 14, 2015
  • 1 reply
  • 1229 views

I have been building my games using FlashDevelop with Flex SDK compiler all the time, but now I need ASC 2.0 with adobe air. So I have migrated to it. But one problem came out, which I just can't find a solution for. I need to embed TTF fonts, which I used to always add additional compiler option -managers=flash.fonts.AFEFontManager for. In this new AIR SDK all I get is the next warning:

command line Warning: 'compiler.fonts.managers' is not fully supported.

And of course fonts do not embed. Is there a solution for it?

Here's how I embed them

[Embed(source = "VERDANA.TTF", fontName = "verdana")]
private static var Verdana: Class;

So, how can I embed fonts in AIR 18?

This topic has been closed for replies.

1 reply

lagoon_bbo
Known Participant
July 15, 2015

try adding

[Embed(source = "VERDANA.TTF", fontName = "verdana", embedAsCFF="false")]

I had the same problem and adding embedAsCFF="false" make it work

Inspiring
July 15, 2015

Thanks for your reply, but no, it won't work.

I've found out that Adobe has removed pre-transcoding of fonts from ASC 2.0. Now all we can do is to use fontswf command line utility to create swf from fonts or to make library of fonts using Flash Pro, and save them as swc or swf.

Then pass font class to Font.registerFont() method to make them available.

Normal embed does not work anymore, with whatever parameters

lagoon_bbo
Known Participant
July 15, 2015

It's realy strange as I use embedded font in my current project and all works great.

note :

- I removed the -managers option in the compiler options.

- I don't use verdana as name but an other font name 'Verdana_'.

- Here is my Embed code :

    [Embed(source="/assets/fonts/VERDANA.TTF", fontName="Verdana_", mimeType="application/x-font-truetype", embedAsCFF="false")]
    /**police Verdana Regular**/
    public var verdanaReg:Class
;