Another approach on anther font. I embedded two variations of the same font, 'regular' and 'bold'. Also gave them AS linkages. Then used this code:
Which partly works. The textfield gets the embedded font. I can tell by running the swf after deactivating the font in question. However, the word 'BOLD' isn't in bold. All characters are in regular style font.Code:this.createTextField("my_txt",1,10,10,400,200); my_txt.multiline = true; my_txt.html = true; my_txt.embedFonts = true; my_txt.htmlText = "<font size='30' face='EuroComic'>This word is not <b>BOLD</b></font></ br>";
I can also use this:
Which the same result. Only this time I'm sure it's using the AS Linkage name. But all characters still in regular style font. Deactivating the font still makes the text use it's embedded font.Code:this.createTextField("my_txt",1,10,10,400,200); my_txt.multiline = true; my_txt.html = true; my_txt.embedFonts = true; my_txt.htmlText = "<font size='30' face='EuroComicRegular'>This word is not <b>BOLD</b></font></ br>";
Finally I tried the css way:
Which works. If my text still contains <b> tags I first have to replace them with my custom <vet> tags, but the result is that characters between <vet> are shown in bold.Code:import TextField.StyleSheet; var myCSS:StyleSheet = new StyleSheet(); myCSS.setStyle("body",{fontSize:'45', fontFamily:'EuroComicRegular'}); myCSS.setStyle("vet",{fontSize:'15', fontFamily:'EuroComicBold'}); myHTML.styleSheet = myCSS; myHTML.html = true; myHTML.embedFonts = true; myHTML.htmlText = "<body>Is dit <vet>vette</vet> tekst?</body>";
Wondering though why the first two options - without css - don't work, since as far as I can tell I did everything 'by the book'. Embedded all variations of the font, embedded all glyphs, gave AS linkages. Shouldn't I then be able to use bold and italic tags on any html text? Can someone explain this to me?
Using CS6 for Mac by the way.




Reply With Quote