I don't know about you but I'm having a really hard time getting my head around TLF.
I'm using Flash CS5. I've got an embedded font loaded from an external SWF. As far as I can tell, it's embedded properly - it used to work before I switched from the classic TextField - but I needed to switch because I need the advanced ligature support. My code is:
//setting up...
var text:TFLTextField = new TLFTextField();
text.width = 530;
text.height = 330;
text.type = TextFieldType.INPUT;
text.text = "Enter your own text here";
text.embedFonts = true;
addChild(text);
var format:TextLayoutFormat = new TextLayoutFormat();
format.fontSize = currentSize;
format.ligatureLevel = LigatureLevel.EXOTIC;
textFlow = text.textFlow;
textFlow.hostFormat = format;
textFlow.flowComposer.updateAllControllers();
//... later on, when the font is loaded:
private function fontLoadedHandler(e:Event):void {
var a:Array = Font.enumerateFonts();
for (var i:Number = 0; i < a.length; i++) {
trace(a[i]); //font name shows up just fine in the list...
}
var format:TextLayoutFormat = new TextLayoutFormat();
format.fontFamily = e.currentTarget.fontName;
format.fontLookup = FontLookup.EMBEDDED_CFF;
format.fontSize = currentSize;
textFlow.invalidateAllFormats();
textFlow.hostFormat = format;
textFlow.flowComposer.updateAllControllers();
}
When I compile, it defaults to Times New Roman. I've done a reasonable amount of Googling, and discovered this: http://forums.adobe.com/message/3477909
The guy seems to have a similar problem to mine, but I've tried his solution and got the same negative result.
Any help or links or anything would be greatly appreciated!
Thanks, Andrey
Edit: Just tried to switch the font to Arial, and it fell back to Times New Roman again. So apparently the problem is not with the embedding, but with the way I assign the font - meaning this may be less complicated than I originally thought. Scratch that, Arial worked after I changed embedFonts to false. So the problem is embedding after all.