Wednesday, November 25, 2009

Embedding Fonts Compiler Issue

The guys at developmentarc have a good article about font embedding online. Probably most of the old time flashers know this already, but still it is nice to have it written up nicely.
In my current project we were trying to do the same. Unfortunately it didn't work.

Enter the magic land of font formats. It turned out, that the fonts were not recognized as bold or italic fonts, even though they were bold or italic fonts actually. The problem was, that the font's internal header didn't have the style flags for bold/italic set. According to the fontshop this was to avoid compatibility problems. So what we had to do, is to open the font in a font editor and set the flags accordingly. After it was working fine.

Nice hack. However, i think it is a symptom of a more fundamental problem.
Flash/Flex uses the styles like bold/italic for two different things. First for telling the compiler which style to embed and second to define, which style the font is supposed to be used for.

Imagine you want to use font A as the normal font and font B as the bold font. However font B is not bold and so the internal font header flag for bold is not set.
Basically this is the same situation as decribed above. You would have to fiddle with the font header again.

The best solution would be to change the compiler really. We should have one flag to tell the compiler which font/style to embed and another flag to tell it, which style this font should be used for.

Feel free to vote and add comments to the feature request in Adobe's bug base:

No comments:

Post a Comment