Skip to main content
Inspiring
Jul 14, 2015 3:35 PM UTC
Question

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

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 is closed to new replies. Start a new post to keep the conversation going.

8 replies

lagoon_bbo
Known Participant
Jul 15, 2015 4:43 AM UTC

try adding

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

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

Translate
Inspiring
Jul 15, 2015 5:25 AM UTC

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

Translate
lagoon_bbo
Known Participant
Jul 15, 2015 8:35 AM UTC

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
;


Translate