1 person found this helpful
I've embedded plenty of OpenType without issue at all. I see it's OT CFF in the drop-down so you might want to try an embed declaration:
fontName = "myFont",
mimeType = "application/x-font",
Take special note of the last directive to embed the font as CFF. Make sure your TextFields are assigned that font and told to embed.
Thanks. I'm actually using the Font Embedding panel in Flash. Seems to be working though I can't get any of the variations to work.
I create a new font in the Font Embedding panel, choose my font and weight (trying Myriad Pro and Myriad Pro Italic), export for actionscript (AS classes fontNormal1 and fontItalic1).
Then in the class where I do my formatting, up top I have:
private var fontNormalFont1:String = 'Myriad Pro';
private var fontItalicFont1:String = 'Myriad Pro Italic';
In my constructor I have:
Then I create my text format:
fmtMainTitle:TextFormat = new TextFormat();
fmtMainTitle.color = 0xffffff;
fmtMainTitle.font = fontNormalFont1;
fmtMainTitle.size = 18;
Which I subsequently apply to text fields (including an embed font directive). It works great if my font is fontNormalFont1, but if I try fontItalicFont1 it comes up blank - no text appears.
I tried creating an instance of the AS class for the italic font, and getting the font name:
fontItalicInst:Font = new fontItalic1();
And I get back "Myriad Pro" - in other words it's only returning the base font name, not the full name.
I'm pretty rusty at AS/Flash, and fonts were never my strong suit, so I could be doing all the the wrong way. I do need to have fonts available in CSS, which could be why I'm registering the fonts (it's been a few years since I built this app).
Would appreciate any advice
Actually I worked it out, thanks to this very helpful post explaining how to embed fonts in CS5:
Turns out the fonts that weren't working (weren't being called properly via CSS) needed to have both font-family and font-style (italic) or font-weight (bold) set in the CSS.
Used to be that I referenced them only by font family: Berthold Akzidenz BE Italic
Now I have to split the attributes:
font-family: Berthold Akzidenz BE
Works great now.
Yes I hope they consolidate the panel a bit more, even as of CS6 they're still requiring each font and all variants to be embedded separately. If I check bold or italic it shouldn't be a stretch for Flash to at least try to identify that variant, even show me a "confirm" dialog with what it thinks is the correct font group and auto-include the correct font and variants.
Be sure to specify the unicode range to embed or those files will get large mighty quick.
Glad you found your solution. Good luck!