TLF and CFF font embedding
Hello,
I have been trying recently to use the TextLayout framework within Flash CS4 quite successfully (I am really excited about the RTL support). The only major problem I encountered concerns cff font embedding in dynamically loaded SWFs.
For several reasons, I'd like to keep the TLF component and embedded fonts in a SWF module separated from the main application (size, compile time, reusability) and load it dynamically on startup. However, the embedded fonts are unavailable to TLF (even though they are listed by Font.enumerateFonts()). I tried to create the runtime libraries both through Flash CS4 and Gumbo (Flex 4). They are being loaded at the startup, I tried to add them to the stage, instantiate the font classes, Font.registerFont - anything I could think of.
The TLF components loads fine and I have full access to its capabilities, only the fonts are unavailable (the device fonts being used instead).
Everything works as it should when I embed the fonts and TLF component directly into the main SWF. (But the compile time is terribly long and the fonts and the framework cannot be shared; so I'd really like to load them dynamically.)
Is it a known issue? Anyone encountered this?
Thanks in advance.
---
Example of the external font swf (for Gumbo):
package {
import flash.display.MovieClip;
import flash.text.Font;
public class Embed extends MovieClip {
[Embed(source="arialbd.ttf",
fontFamily="Arial CFF",
mimeType = "application/x-font",
fontWeight = "bold",
cff = "true")]
public var Font1:Class;
[Embed(source="AGSCHBQM.TTF",
fontFamily="Akzidenz Grotesk BE Bold",
mimeType = "application/x-font",
fontWeight = "normal",
cff = "true")]
public var Font2:Class;
[SWF(width = "1024", height = "768")]
public function Embed() {
Font.registerFont(Font1);
Font.registerFont(Font2);
}
}
}
