Skip to main content
Inspiring
November 4, 2009
Question

Embedded font works in AIR but not SWF

  • November 4, 2009
  • 1 reply
  • 560 views

I have one code base, which my AIR and web application both use.  In the AIR app, the font is used and rendered as expected.  In the web app, the font is not the same as the AIR application's font.  Why is this, since they are using the same code base and assets?

The embedded font is in a external SWF and is embedded via a CSS file, example:

@11220649-face {
    src: url("/../assets/flash/EducationFonts.swf");
    fontFamily: TimesDF4;
    embeddAsCFF: true;
}

And the AIR and web application both output the same message from this function:

            private function enumerateFont():void
            {
                var myEmbeddedFonts:Array = Font.enumerateFonts(false);
                var f:Font;

                for (var i:int=0; i<myEmbeddedFonts.length; i++)
                {
                    f = myEmbeddedFonts;
                    trace (i+"---"+f.fontName+"---normal/normal = "+FontDescription.isFontCompatible(f.fontName, "normal", "normal"));
                    trace (i+"---"+f.fontName+"---normal/italic = "+FontDescription.isFontCompatible(f.fontName, "normal", "italic"));           
                    trace (i+"---"+f.fontName+"---bold/normal = "+FontDescription.isFontCompatible(f.fontName, "bold", "normal"));           
                    trace (i+"---"+f.fontName+"---bold/italic = "+FontDescription.isFontCompatible(f.fontName, "bold", "italic"));                   
                    trace("");
                }           
            }

This topic has been closed for replies.

1 reply

injpixAuthor
Inspiring
November 4, 2009

Found a solution, I did the following in FB:

Project > Properties > Flex Build Path > Library path > Framework linkage: Merged into code

So I selected the Merged into code option.