TextFields are no longer respecting bold and italic tags nor TextFormat bold and italic properties.
I embedded Times New Roman Regular, Bold and Italic (uppercase and lowercase letters). I also made sure all three are exported for actionscript in the first frame.
When I run the following code, I notice two things immediately. 1st, Flash CC does not respect the b and i tags in HTML text anymore, because the text is all regular. That completely breaks all existing applications. 2nd, either "Times New Roman" (regular) or "Times New Roman Italic" is not listed as being embedded according to Font.enumerateFonts call, despite both being embedded and exported for actionscript. It seems to depend on whether or not there is a text field on the stage using the regular font. If one is not present, then "Times New Roman" (regular) is missing from enumerateFonts, and if a text field is present, then suddenly "Times New Roman" (regular) is present, but "Times New Roman Italic" goes missing.
import flash.text.Font; //Embed times new roman regular, bold and italic (uppercase and lowercase) //Make sure all three are exported for actionscript in the first frame. for each ( var s:Font in flash.text.Font.enumerateFonts( true )) { if (s.fontName.substring(0,5) == "Times") trace(s.fontName + ", " + s.fontStyle + ", " + s.fontType); } var txt:TextField = new TextField(); txt.x = 0; txt.y = 0; txt.width = 500; txt.height = 200; txt.defaultTextFormat = new TextFormat( "Times New Roman", 56, 0x000000, false, false, false ); txt.selectable = false; txt.embedFonts = true; txt.type = TextFieldType.DYNAMIC; txt.wordWrap = false; txt.multiline = false; logo.border = true; txt.htmlText = "Times <i>Times</i> <b>Times</b>"; addChild( txt );
Fonts are completely broken in Flash CC. This is totally unacceptable. There are numerous threads posted on this topic, and I have no idea why this hasn't been fixed.
This works exactly as expected in CS6. All three fonts are embedded, they enumerate properly, and it reespects and b and i tags at runtime.
Furthermore, even if you guys completely changed everything to use unique font names and did deprecate the b and i tags, they still can't even be affected by stylesheets:
var styleSheet:StyleSheet = new StyleSheet(); styleSheet.parseCSS("p {font-family: Times New Roman; font-size: 56;} i {font-family: Times New Roman Italic;} b{font-family:Times New Roman Bold;}" ); txt.styleSheet = styleSheet; txt.htmlText = "<p>Times <i>Times</i> <b>Times</b></p>";
The above addition has no effect. The i and b tags are still rendered as regular text.