I tried even with Flex SDK 4.5.1, but the problem persists. I even set the fontLookup property of the TextLayoutFormat to FontLookup.EMBEDDED_CFF, but not even that helps
There is a post on my blog about embedded fonts. If your fonts are loaded
in a separate SWF there are some additional steps you will need to do.
Thanks for your answer. The CSS embedding the font(s) is in the same SWF that uses them (I have only one SWF). I forgot to mention that if I set text.setStyle("fontFamily", "BlackJack") the entire RichEditableText shows the embedded font properly. So, this appears to be really a matter of what the TextLayoutFormat can do or not do. I found your March 12, 2010 post, but I haven't been able to use it to figure this issue out. Either way, I appreciate your time.
I think the RichEditableText needs to have an embedded font specified as the font family so it will use embedded fonts in the textflow ranges.
Flex SDK Developer
Adobe Systems Inc.
That's exactly what I was trying to do:
var newTlf : TextLayoutFormat = new TextLayoutFormat; newTlf.fontFamily = "BlackCasper"; text.setFormatOfRange(newTlf);
However, for some reason, the selection is not rendered to the embedded font "BlackCasper" as it should. Instead, the text is rendered in some random system font that is not "BlackCasper". For all widgets that accept CSS styling, I can use "BlackCasper" perfectly with setStyle. I really don't get what I am doing wrong with the way I use TextLayoutFormat
You are setting a TextLayoutFormat which is used by the underlying text
subsystem. Flex probably doesn't tell it to use embedded fonts unless the
fontFamily style on the RichEditableText is an embedded font.
Yes, that worked! Thanks so much.