views:

52

answers:

2

So, in Flash Builder on Windows, my app and all embedded fonts compile just fine.

But when I try to build it on my production Linux server (via a Makefile on the command line using make), compilation fails while transcoding the fonts:

/home/me/MyFlexProject/SomeModule/src/Fonts.as(29): Error: exception during
transcoding: Font for alias 'HelveticaRounded LT Std Blk' with plain weight
and style was not found at:
file:/home/me/MyFlexProject/SomeModule/src/assets/fonts/HelveticaRoundedLTStd-Black.otf

            [Embed(source='/assets/fonts/HelveticaRoundedLTStd-Black.otf',
            fontName='HelveticaRounded LT Std Blk',
            mimeType='application/x-font',embedAsCFF='false')]

Things I have tried:

  • Using a different font manager, via "-managers=flash.fonts.AFEFontManage".

  • Using different fonts, but it either gives a slightly different version of the usual error, see:

    Error: exception during transcoding: Font for alias 'xxx' with plain weight and style was not found at: file:...

Looking at the font using fontforge, I think I've narrowed the problem down to the fact that apparently within the font file there are both "Windows" and "Mac" names defined. This seems like the possible culprit since on Windows the font compiles fine, but then on Linux it can no longer find a font with the same name. However, even when I switched to using the "Mac" name on Linux, I still get the same error about not being able to find a font with the requested name.

I want to find out what is going on that is preventing the transcoding from being able to happen.

Here is a link to the font in question: http://jetlib.com/HelveticaRoundedLTStd-Black.otf

For good measure, here is Fonts.as:

package ...
{
    import flash.text.Font;

    public class Fonts
    {
        [Embed(source='/assets/fonts/HelveticaRoundedLTStd-Black.otf',
        fontNam e='HelveticaRounded LT Std Blk', fontWeight='normal',
        mimeType='application/x-font',embedAsCFF='false')]

        private static var _font1:Class;

        /**
         * register fonts with the font manager to be
         * used in modules and sub applications
         */
        public static function registerFonts():void
        {
            Font.registerFont(_font1);
        }
    }
}

Any help, thoughts, or insights would be GREATLY appreciated!

Output using fontWeight='bold':

/home/me/MyFlexProject/SomeModulesrc/Fonts.as(23): Error: exception during transcoding: Font for alias 'HelveticaRounded LT Std Blk' with bold weight was not found at: file:/home/me/MyFlexProject/SomeModulesrc/assets/fonts/HelveticaRoundedLTStd-Black.otf

                [Embed(source='/assets/fonts/HelveticaRoundedLTStd-Black.otf',fontName='HelveticaRounded LT Std Blk',fontWeight='bold',mimeType='application/x-font',embedAsCFF='false')]

/home/me/MyFlexProject/SomeModulesrc/Fonts.as(23): col: 3: Error: unable to build font 'HelveticaRounded LT Std Blk'

                [Embed(source='/assets/fonts/HelveticaRoundedLTStd-Black.otf',fontName='HelveticaRounded LT Std Blk',fontWeight='bold',mimeType='application/x-font',embedAsCFF='false')]
  ^

/home/me/MyFlexProject/SomeModulesrc/Fonts.as(23): col: 3: Error: Unable to transcode /assets/fonts/HelveticaRoundedLTStd-Black.otf.

Output with fontWeight='normal':

/home/me/MyFlexProject/SomeModulesrc/Fonts.as(23): Error: exception during transcoding: Font for alias 'HelveticaRounded LT Std Blk' with plain weight and style was not found at: file:/home/me/MyFlexProject/SomeModulesrc/assets/fonts/HelveticaRoundedLTStd-Black.otf

                [Embed(source='/assets/fonts/HelveticaRoundedLTStd-Black.otf',fontName='HelveticaRounded LT Std Blk',fontWeight='normal',mimeType='application/x-font',embedAsCFF='false')]

/home/me/MyFlexProject/SomeModulesrc/Fonts.as(23): col: 3: Error: unable to build font 'HelveticaRounded LT Std Blk'

                [Embed(source='/assets/fonts/HelveticaRoundedLTStd-Black.otf',fontName='HelveticaRounded LT Std Blk',fontWeight='normal',mimeType='application/x-font',embedAsCFF='false')]
  ^

/home/me/MyFlexProject/SomeModulesrc/Fonts.as(23): col: 3: Error: Unable to transcode /assets/fonts/HelveticaRoundedLTStd-Black.otf.
+2  A: 

Is it failing both with and without fontWeight='bold'? Your two snippets variably include and omit that line. One of the two is correct.

Edit: apparently it fails in both cases. I've got nothin'.

Cory Petosky
I have tried it both ways, and it fails both ways. I've included the error output above since these comment boxes are so tiny.
pyrony
Hmm, we've passed my threshold, sorry. One thing you can try is saving as TTF in FontForge -- I've had strange errors with OTF with a Linux embed before.
Cory Petosky
Ok, thanks for your time :)
pyrony
BTW, are you saying that you have successfully embedded and compiled TTF fonts on Linux before? If so, is there any chance you could point me at them so I can try embedding them into my app just as a test?
pyrony
I successfully embed both OTF and TTF fonts from Linux. However, I've noticed that sometimes the glyphs on OTF fonts are a little strange compared to a Windows/Mac build, and additionally I've noticed Flash ignores the range of characters I specify to embed when I embed OTF on Linux -- it always embeds the full Unicode range, bloating my SWF by 100k+. Unfortunately I can't provide example files as all our fonts are licensed.
Cory Petosky
This is helpful. Thank you very much.
pyrony
+2  A: 

I can only guess as I haven't yet tried to embed fonts on Linux. But from what I know, the behaviour of the font-manager is dependant on the OS as every Operating System has a different font API that is presented to the underlying Java framework of Flex. The fontWeight parameters can differ from platform to platform.

Have you tried "Black" as the value for fontWeight? If my guess is right, the font-manager could not ask the system for the weight of this font and tried to find the weight inside the otf. But the otf has "Black" defined as its weight. I hope this helps, kind regards...

dreipol
Yes, I've tried "Black" and "black" as the fontWeight, but AS3 doesn't seem to recognize it and still gives the same errors as before (The output indicates it's still looking for "normal" fontWeight).:s
pyrony
Hmmm... one last guess before I run out of ideas: Have you tried using the fontWeight together with the fontStyle attribute? In your case: "fontWeight='bold', fontStyle='normal'" or "fontWeight='black', fontStyle='normal'"? Font embedding is tricky.
dreipol
I've tried those. Font embedding seems to be quite tricky on Linux..
pyrony