Actionscript htmlText + embedFonts not showing <b>bold</b> text

989 Views Asked by At

There seems to be a lot of similar questions but no definitive answers about this.

My project is Actionscript3 using Flash. I have text loaded into a dynamic TextField using htmlText from a XML file.

All works ok & text formatting is good (using TextFormat) but the fonts are incorrect. So i use textField.embedFonts = true.

Now the font is correct but my html tags (<b>bold text</b>) are un-bolded - ie. normal font.

Is what I am trying to do impossible to achieve or am i missing something?

I don't wish to use CSS - if i don't have to, my fonts (normal & bold) are embedded in my project (to my knowledge), i've put a TextField using a bold font on the stage, <![CDATA[ tags are in the XML... not sure what else to try, any help is appreciated.

2

There are 2 best solutions below

1
On

Are you setting the text or htmlText property with the loaded text?

3
On

You have to make sure that bold type of the font has been embedded.

In Flash Professional use Font embedding panel:

enter image description here

see this for more info (find 'Embed fonts' at the bottom) : http://blog.codestage.ru/2011/07/14/efficient-flash-pro-using/

In Flex use CSS :

@font-face {
    src: url("location") | local("name");
    fontFamily: alias;
    [fontStyle: normal | italic | oblique;]
    [fontWeight: normal | bold | heavy;]
    [advancedAntiAliasing: true | false;]
}