The htmlText property always gives me fits when I need to display highly-formatted text. It does have bugs.
Often the issue is with your embedded font and the actual html tags you feed into the component. Keep in mind it may not be anything you are doing, just how the htmltext property is behaving (misbehaving?)
A free AIR component "htmlText Editor" has been very helpful to me in diagnosing the html tags which Flex sometimes chokes on:
You can use it to experiment with adding/removing the html tags in your text to see if the component suddenly starts behaving.
- Check your embedded font and make sure it includes not just a subset, but all the characters in the font.
- Try embedding the Bold, Italic and the Bold Italic variations of Myriad Pro, as well as the normal and see if this clears things up.
- Try embedding a completely different font and see if that clears it up.
- In your html tags, switch <b> tags to <i> tags and see if you get the same behavior.
I know this sounds somewhat insane. It is, but it may help you to narrow down what is causing the behavior. Often, you end up doing some kind of work-around with htmltext.
You could try increasing the spacing between characters a bit.
What exactly do you mean? Is there some property I can set to determine the spacing? I do not want to expicitly place a space in the text, as the issue is sporadic.
How do I embed the Myriad Pro font into that htmlTextEditor application? I tried replicating the problem with the fonts that are already there and all is fine. Again, though, I attempted this in my flex application, but I would rather use the font that we use elsewhere in the app (Myriad Pro).
Use the htmlTextEditor app just for troubleshooting the html tags, not for embedding the font.
So, then I cannot use the Myriad Pro font in htmlTextEditor?