1 2 Previous Next 41 Replies Latest reply: May 1, 2015 3:55 PM by thehiatus RSS

    BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text

    eigenface Community Member

      Concise problem statement:

       

      If you compile with flash pro CC, and use the 'setTextFormat' method of a TextField, the 'bold' and 'italic' properties of the TextFormat argument have no effect on the rendered text. If you compile with flash pro CS6, the 'bold' and 'italic' properties work as expected.

       

      Apparently, with flash pro CC, the only way to make the text render correctly is to change the font name (add the suffix ' Bold', ' Italic', or ' Bold Italic'.) This means code which dynamically changes font styles only works in CS6 or CC, but not both. For example, if you use the 'bold' property the text renders bold in CS6 and regular in CC, whereas if you change the font name to add the suffix ' Bold', the text renders bold in CC and DOES NOT RENDER at all in CS6. This makes it difficult to transition a team from CS6 to CC.

       

       

      Steps to reproduce bug:

       

      1. Create an xfl with 2 TextFields on the stage, both with font "Trebuchet MS" and style "regular", one named boldTrueText containing the String "bold = true", one named fontNameText containing the String "fontName = Trebuchet MS Bold". Create 2 more TextFields on the stage for visual reference, both with font "Trebuchet MS", one with style "regular", one with style "bold".

      2. Add the following code to the Actions panel on frame 1:

       

      import flash.text.TextFormat;

      import flash.text.Font;

       

       

      var format:TextFormat = boldTrueText.getTextFormat();

      format.bold = true;

       

      boldTrueText.setTextFormat(format);

       

      format = fontNameText.getTextFormat();

      format.font = "Trebuchet MS Bold";

       

      fontNameText.setTextFormat(format);

       

      var fonts:Array = Font.enumerateFonts(), count:int = fonts.length;

       

      for (var i:int = 0; i < count; i++) {

        

          var font:Font = fonts[i];

          trace("fontName: " + font.fontName + ", fontStyle: " + font.fontStyle);

      }

      3. Save, and compile with flash pro CS6 and flash pro CC.

       

       

      Results:

       

      With flash pro CS6, "bold = true" renders bold, and "fontName = Trebuchet MS Bold" DOES NOT RENDER.

      With flash pro CS6, the following is traced:

      fontName: Trebuchet MS, fontStyle: bold

      fontName: Trebuchet MS, fontStyle: regular

       

      With flash pro CC, "bold = true" renders regular, and "fontName = Trebuchet MS Bold" renders bold.

      With flash pro CC, the following is traced:

      fontName: Trebuchet MS, fontStyle: regular

      fontName: Trebuchet MS Bold, fontStyle: bold

       

       

      Expected results:

       

      The same text is rendered in both flash pro CS6 and CC. I don't know why this behavior was changed in flash pro CC - it causes silent failures in code which dynamically changes font styles. I expected the flash pro CS6 behavior to remain the same in CC, like so:

       

      With flash pro CC, "bold = true" renders bold, and "fontName = Trebuchet MS Bold" DOES NOT RENDER.

      With flash pro CC, the following is traced:

      fontName: Trebuchet MS, fontStyle: bold

      fontName: Trebuchet MS, fontStyle: regular

       

      If you don't want to break backward compatibility (any further), you could make both the behaviors work in flash pro CC, like so:

       

      With flash pro CC, "bold = true" renders bold (font is still "Trebuchet MS"), and "fontName = Trebuchet MS Bold" renders bold also.

      With flash pro CC, the following is traced:

      fontName: Trebuchet MS, fontStyle: bold

      fontName: Trebuchet MS, fontStyle: regular

      fontName: Trebuchet MS Bold, fontStyle: bold

       

      I submitted this bug with the bug form, and also with adobe bugbase (in case it isn't obsolete) - I'm just trying to maximize my chances of getting a fix.  Has anyone else encountered this bug?

        • 1. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
          kglad MVP

          the only way to get consistant and predictable fonts with flash is to embed fonts.

          • 2. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
            eigenface Community Member

            I understand that, and I have been embedding fonts.  Even embedding fonts, I STILL get inconsistent results when I compile with flash pro CC versus flash pro CS6.  Backwards compatibility is broken for fonts.

             

            Apparently, flash pro CC uses different font names to denote style and ignores the 'bold' and 'italic' properties of TextFormat. Conversely, flash pro CS6 respects the 'bold' and 'italic' properties and does NOT use different font names for those styles (so if you do use different font names, the font is undefined and nothing renders.)  This is true even when I embed all the relevant fonts.

             

            This guarantees code which dynamically changes font styles will break in either CC or CS6 - CC is NOT backwards compatible in terms of fonts.  This creates a big problem for say, a localization system that dynamically changes fonts and styles.

            • 3. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
              kglad MVP

              if you're relying on system font names, you're not embedding your fonts correctly.  your fonts should be in your library.  they should be exported for use with actionscript and have class names that are used to embed them dynamically.

              • 4. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                eigenface Community Member

                Let me be clear - this is not a matter of font names varying between different systems.  Using flash CS6, the font names are the same on all of our test machines (windows and mac.)  Using flash CC, the font names are also the same on all of our test machines.  The issue is that the font names are different between flash CS and flash CC, and that the 'bold' and 'italic' properties of TextFormat are not respected by flash CC.

                 

                Our fonts are embedded, and they are in our library.  They are exported for use with actionscript, and they have class names (this is the only way to get them to compile into the swf if there are no TextFields using those fonts at compile time.)  The broken backward compatibility between flash CS and CC is a bug in and of itself - font names are DIFFERENT on the SAME system when using CC versus CS6, and the 'bold' and 'italic' properties of TextFormat are always respected by CS6 but never respected by CC.  This leads to silent failures - text that rendered correctly in flash CS6 does not render correctly in CC, with no errors.

                 

                I think you are suggesting a possible work-around for this bug: to specify font class names in our localization data instead of font names.  I had considered this work-around, but it would require rewriting our localization framework, and it would require changing all our localization data for our games.  I'm hoping this bug will be fixed, and the font behavior in CC will be backwards-compatible with CS6. This breaking change in behavior was not in the documentation; for example, the 'bold' and 'italic' properties of TextFormat are not listed as deprecated in CC.

                • 5. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                  kglad MVP

                  font names are irrelevant if you're embedding fonts correctly.  the only thing that matters are the font class names.

                  • 6. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                    eigenface Community Member

                    Can you give me an example of the correct way to embed fonts?

                    • 7. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                      paulsakebomb Community Member

                      I am having the same issue.  I am defining the font face in html via xml.  Before to get Arial Bold you would define the font face as "Arial" and then use <b></b>.  This no longer works.  It seems that the font face is going to need to be changed to "Arial Bold" in all of the localized xml files if CC is going to be used.

                      • 8. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                        kglad MVP

                        there's problem with fonts and mac computers.

                         

                        on windows the problem is incorrect embedding of fonts.

                        • 9. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                          eigenface Community Member

                          Windows and mac have identical behavior in the follow respects.  On windows and mac:

                           

                          - 'bold' and 'italic' properties of TextFormat are respected by flash CS6, and are not respected by flash CC (using the exact same code, exact same xfl file, with regular, bold, italic, and bold-italic styles embedded as separate fonts, and all 4 have as3 classes exported)

                          - <b> and <i> tags in htmlText are respected by flash CS6, and are not respected by flash CC  (using the exact same code, exact same xfl file, with regular, bold, italic, and bold-italic styles embedded as separate fonts, and all 4 have as3 classes exported)

                           

                          "on windows the problem is incorrect embedding of fonts."

                           

                          I have seen zero evidence to support this assertion, and no indication of what the "correct" way to embed fonts might entail.  In my first post in this thread, I provided source code to reproduce the problem and trace outputs detailing my results.  Failure to acknowledge the issues does not nullify it.

                          • 11. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                            paulsakebomb Community Member

                            This isn't an example of using font face, <b>, <i> with htmlText though.

                            • 12. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                              eigenface Community Member

                              Perfect example!  So, compile this fla on windows with flash CS6 instead of CC, and all of the text is regular.  Really.  For really reals.  I am not lying.  This is because, as I've been saying, the fontName is different for CC than for CS6.  In order to make this work right for both CS6 and CC, you need to populate the "bold" and "italic" properties of your TextFormat instances with values indicated by the fontStyle property of your Font instances.  This is the work-around I ended up using.

                               

                              So are we agreed?  Will you admit the behavior is different for CS6 versus CC on the same machine?  Really, run my example code, and you'll see exactly why: the style information is included in the fontName for CC but not CS6, and CC ignores the "bold" and "italic" properties while CS6 respects them (and in fact requires them to render the correct style.)  Seriously, just run the code.  It will only hurt for a minute.

                              • 13. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                kglad MVP

                                yes, the example fla i posted works differently in cs6 and cc.

                                • 14. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                  hencca2012 Community Member

                                  I spent half a day on this. I then decided to test the code in CS6 (luckily hadn't removed it). CC most definately ignores <b>text</b> when CS6 renders them bold. And yes I've embedded the fonts correctly.

                                   

                                  here's my code, which renders differently between flash versions:

                                   

                                   

                                   

                                  var e:TextField = new TextField();

                                  addChild(e);

                                  e.width = 300;

                                             

                                  var a:Font = new Arial();

                                             

                                  var tmpStyle:StyleSheet = new StyleSheet();

                                   

                                  tmpStyle.setStyle("p" ,{fontFamily:a.fontName, fontSize:"33px"});

                                  e.styleSheet = tmpStyle;

                                             

                                  e.embedFonts = true;

                                  e.htmlText = "<p><b>bold</b>normal</p>";

                                   

                                  • 15. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                    dprestescc Community Member

                                    I'm having this problem too here, I have old projects of mine that stopped working because I have changed to Flash CC and now the italic and bold don't work anymore.

                                     

                                    I have done this code and got 2 different results on Flash CS5.5 and CC. It's basically what the other guys have told before, maybe now it's more clear to understand.

                                     

                                    When I do this code to show my embeded fonts I get these results:

                                     

                                    var fontList:Array = Font.enumerateFonts();

                                    for( var i:int = 0; i < fontList.length; i++ ) {

                                        trace("Font Name: " + fontList[i].fontName + ", " + fontList[i].fontStyle )

                                    }

                                     

                                    CC

                                    Font Name: Arial, regular

                                    Font Name: Arial Bold, bold

                                    Font Name: Arial Italic, italic

                                     

                                    CS5.5

                                    Font Name: Arial, italic

                                    Font Name: Arial, regular

                                    Font Name: Arial, bold

                                     

                                    On Flash CS5.5 I used to have one font and several styles embeded for it, so I could use Arial as font name in my TextFormat and could add any <b> <i> tags in my text that would work.

                                    Now on Flash CC it seems that every style is a different font, so we have font Arial, Arial Bold and Arial Italic, what makes the html tags useless, because for the font with name Arial it's only embedded the regular font.

                                     

                                    Is there a way to workaround it? Because I have several words in my site that I need to show some in italic and the others as regular, so this way I can't work with it.

                                    I also tryed to return to flash CS5.5 but when I try to open my fla on it the 5.5 crashes when I try to compile it and I get several messages saying it's not compatible, so return to CS5.5 it's not an option too.

                                    • 16. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                      Elliot Harris Community Member

                                      I have the same problem, and I'm thankful for this discussion which at least allowed me to understand a possible workaround.

                                       

                                      That said, it's not a usable workaround in our case. Previously we could embed Arial in both regular and bold styles, and then have HTML text which looked like this:

                                      some text <b>this part in bold</b>

                                       

                                      Now however it needs to look like this:

                                      some text <font face="Arial Bold">this part in bold</font>

                                       

                                      All of this is drawn from XML. The problem is we already have a lot of deployed XML files, which use the former method. So I can't publish our font library from Flash CC, because it will break all our existing deployments (the font won't render at all). Good thing we kept a copy of CS5 lying around, although having to use that in this case is not only unnaceptable given that we paid to upgrade, but is also a massive pain in terms of our workflow.

                                       

                                      Not only that, but the bug noted here has also cost us a lot of time:

                                      http://forums.adobe.com/message/5425262

                                       

                                      Is Adobe ever going to apologise and fix these things? We've paid for upgraded software but have suffered significant regression.

                                      • 17. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                        SujaiS Adobe Employee

                                        Have you applied the latest update - version 13.1.0.217? Do you still see this.

                                         

                                        -Sujai

                                        • 18. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                          dprestescc Community Member

                                          I checked it again here with the last version, but it seems this still happens.

                                           

                                          I had to do what Elliot Harris said, was the only solution I could think to fix the problem here on my project.

                                          • 19. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                            Elliot Harris Community Member

                                            I actually hadn't been notified of an update so thanks for pointing that out. However I've updated now and the problem remains.

                                            • 20. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                              Nipun Asthana Adobe Employee

                                              Thanks for reporting this issue. Following your steps it's reproducible and has been logged internally.

                                              Will update here once the fix is available.

                                               

                                              -Nipun

                                              • 21. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                Ace Hoffman Community Member

                                                Although this works:

                                                 

                                                <font face='Arial Bold'>some text I want bold</font>

                                                 

                                                Additional font features do not work in Flash CC that worked in CS6.  For example, this does not work:

                                                 

                                                <font face='Arial' size=34 color='#005500'>big dark green text</font>

                                                 

                                                I hope this is fixed quickly too!

                                                • 22. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                  dprestescc Community Member

                                                  Hello Ace Hoffman,

                                                   

                                                  I checked this that you wrote here and it's working for me, the only difference is that the size=34 I used with quotes like this size='34' maybe this was your problem.

                                                   

                                                  Anyway it's not a good solution for me as we need to remove all the layout info (font, size, color) from the TextFormat to include together with the text.

                                                  • 23. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                    James22s22 Community Member

                                                    Has this ever been fixed?   That's a pretty big deal that html tags "b" and "i" are ignored in Flash CC.  That effectively renders the entire application useless with absolutely zero chance that I'll ever upgrade to it.  In my trial, I'm finding that files which compile and run fine in CS6 suddenly have fonts missing in CC.  Fonts such as "Myriad Pro" and "Eras Bd BT" are properly embedded, but don't show up at runtime.  I've added text fields with the embedded fonts to the first frame.  I even tried uninstalling a windows update (kb2753842) which could have been causing problems for some fonts, but that had no effect.  Bottom line... files that compile and run fine in CS6, do not work when opened in CC on the same machine.

                                                    • 24. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                      Ace Hoffman Community Member

                                                      The answer by dprestescc resolved it.  I needed quote marks.

                                                      • 25. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                        eigenface Community Member

                                                        James22s22, nope, never been fixed - I just retested.

                                                         

                                                         

                                                        I suspect your problem is you're setting font using TextFormat.font or the TextField.htmlText tag <font face="blah">.  The font name/face is also sometimes different between CS6 and CC on the same machine.  Yes...

                                                         

                                                         

                                                        The fix is to export the font for actionscript, and use the font class name to set the font.  Instantiate the font class, and use its Font.fontName property to set TextFormat.font or the TextField.htmlText tag.  Font.fontName will be different between CS6 and CC, but it won't matter.

                                                         

                                                         

                                                        However, to get it to work right in CS6 as well as CC, you also have to use Font.fontStyle to set TextFormat.bold and TextFormat.italic, as well as add (or subtract) <b> and <i> tags as appropriate in TextField.htmlText.  This is because although CC ignores bold and italic, CS6 needs them in order to display the font correctly.

                                                         

                                                         

                                                        This is a huge pain if you use a lot of htmlText, because not only do you have to substitute the right face into <font face="blah"> tags, you also have to make sure the right substrings within the htmlText are surrounded by <b> and <i> tags, which means looking back much earlier in the htmlText, maybe closing and reopening <b> or <i> tags to avoid a non-bold/italic substring, etc.  Yes, I know...

                                                         

                                                         

                                                        On more gotcha - if you loaded your fonts dynamically in a separate swf, you may need to register them in the global font list from the swf that's using the fonts, with Font.registerFont.

                                                        • 26. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                          James22s22 Community Member

                                                          @ Ace Hoffman  Uh, no.  That was an entirely unrelated problem that had nothing to do with Flash not reading bold and italic tags in the HTML.  The missing quotes was just a dumb mistake that would always fail to work in any version of flash, because it's not valid html.  That's not the same as it not respecting bold and italic tags and using the wrong font names.

                                                           

                                                          As of the most recent December 2013 update to Flash, the font name problem still exists.

                                                           

                                                          Specifically, I have a font named "Eras Bd BT".  That's it's family name.  That's how it shows up in Flash CS6 and even in Flash CC as well in the font library.  However, at runtime, Flash CC will display nothing if the font name "Eras Bd BT" is supplied.  If you print out all the "fontName" property values when enumerating fonts with Font.enumerateFonts, you'll find that it lists a font named "Eras Bold BT", and says it's embedded.   So why this discrepancy?  Why does the font family name show up in the font library of Flash CC and Flash CS6 as "Eras Bd BT", but at runtime in Flash CC only (I'm opening the exact same file, btw), it suddenly fails to work at runtime and it's obviously why... it's using a different name for the font.  What is going on?

                                                          • 27. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                            James22s22 Community Member

                                                            @ eigenface Unfortunately, such a workaround will not work for me.

                                                             

                                                            My "export classes in frame" option is set to frame 2 under ActionScript settings, because I'm using a preloader and want all the classes pushed to frame 2 unless they are used on frame 1 explicitly.   If I try to export the font for actionscript with a name like "ErasBdBT" and check the "export in frame 1" option (btw, it should say frame 2 like it does for non-font classes, so wtf), it ends up throwing a runtime error "ReferenceError: Error #1065: Variable ErasBdBT is not defined.", despite having a text field on frame 1 with the embedded font, which should force it onto that frame.  If I don't check "export in frame 1", it still doesn't show up.  I've tried every possible combination of font family name variation in code and on the on-stage text field, including selecting the embedded class name ending in a "*" in the properties window for the text field, and it just will not work in Flash CC.   In any case, it works fine in CS6, and any kind of workaround in CC will not work.  I absolutely cannot use Flash CC until these horrific bugs and inconsistences are fixed.

                                                            • 28. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                              eigenface Community Member

                                                              Sorry, I don't have much experience with integrated preloaders - I always export classes in frame 1, and I use a different swf as a loader/manager for game swfs.  If I had to guess though, I'd say the problem is with the preloader, seeing as a class is missing.  Maybe the font classes are being exported in frame 2.  What happens if you export classes in frame 1, and alternately, what happens if you don't use any embedded fonts until frame 2?

                                                              • 29. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                                James22s22 Community Member

                                                                Ok, I actually just got it to work after I realized what was going on.

                                                                 

                                                                The problem is actually strictly the difference in font names between CS6 and CC (at runtime only, since it actually displays the same name as CS6 in the designer).

                                                                 

                                                                There is definitly a bug with the "export in frame 1" option for fonts, because it should reflect the frame number I select in the actionscript settings, just as it's reflected in the export options for all other library symbol types.  They must have just skipped over or forgot to ensure the font property's export for actionscript settings reflects the proper frame.  If I check the option "export in frame 1", my size report shows that the font is in fact exported on frame 2 as expected (hence the reference error when trying to use it on frame 1), so that's just a bug in the interface.

                                                                 

                                                                Once I realized that much was just a bug in the interface, I unchecked the "export in frame 1" option, so that instead of being exported in frame 2, it would actually be exported in frame 1 thanks to the dummy text field using the font on the frame 1 for the preloader.

                                                                 

                                                                As you suggested, the only way to get the REAL font name at runtime is to either instantiate the class or use the value returned by Font.enumerateFonts.   Using Font.enumerateFonts, I'd have to do a fuzzy match on the name to deal with differences in the expected name, so instantiating Font and checking the fontName is the only way to get embedded font names reliably in Flash CC.  This sucks, btw.

                                                                 

                                                                I still don't know if I can even use Flash CC in this condition, because all of my content references font names that won't work in files compiled with Flash CC.

                                                                 

                                                                The only place I can find "Eras Bold BT" in the system windows font directory is under the Details tab of the true type font file's properties, where it's "Title" attribute is "Eras Bold BT".  If instead I preview the font file with windows font preview, it shows the Font name is "Eras Bd BT".  So the question is, why is Flash CC using the font title instead of the actual font family name as it should be and does under all other circumstances except at runtime?
                                                                fontnamediffers.png

                                                                • 30. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                                  eigenface Community Member

                                                                  Glad you got it to work!

                                                                   

                                                                   

                                                                  Would you mind reporting the interface bug via adobe's bug report form, so others can benefit from the time spent here today?

                                                                   

                                                                   

                                                                  https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

                                                                   

                                                                   

                                                                  FYI, I've reported bugs with that form and got them fixed before, so I know it's possible.

                                                                  • 31. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                                    James22s22 Community Member

                                                                    I will, but it's not just the interface bug.   The core issue is that it's using the wrong font names.

                                                                     

                                                                    It's using the font title instead of the font family name.  That's perhaps why people were needing to add "Bold" and "Italic" to the ends of the font names, and it wasn't respecting the bold and italic properties of the TextFormat object.

                                                                     

                                                                    For example, a font like "Eras ITC" has a family name of "Eras ITC".  You should be able to use that same name for bold and italic versions via the text format object, but you can't in Flash CC, because it's opting to use the individual font titles like "Eras Bold ITC".  It's all very inconsistant.

                                                                    • 32. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                                      eigenface Community Member

                                                                      Yeah, I see what you mean.  That may be the root problem of TextFormat.bold/italic and <b>/<i> tags not being respected.  In CC, Font.fontName is unique to the style of the font ("Trebuchet MS Bold") and setting TextFormat.bold = false or TextFormat.italic = true makes no difference, whereas in CS6, Font.fontName is agnostic with respect to style ("Trebuchet MS") and setting TextFormat.bold/italic works as expected (assuming all needed styles are embedded.)

                                                                       

                                                                       

                                                                      This change may have been intentional, despite it's unfortunate side effects.  For example, I use a font called "Museo Sans" with styles in the drop-down menu like "100", "100 Italic", "300", "500", "500 Italic", etc.  Bold and italic are not universal styles, so in retrospect boolean values like TextFormat.bold/italic and <b>/<i> tags seem like the wrong approach - better to set style as an arbitrary string, like font family.  So maybe adobe's half-assed solution to this was append style information to Font.fontName, and stop respecting TextFormat.bold/italic and <b>/<i> tags.

                                                                       

                                                                       

                                                                      If it were me, I would have added a new property TextFormat.fontStyle, and also added another attribute to the TextField.htmlText tag <font face="Museo Sans" style="500 Italic">.  In this case, Font.fontStyle could have values like "100", "100 Italic", etc. in addition the constants in the FontStyle class.  For those fonts with "bold" and "italic" styles, TextFormat.bold/italic and <b>/<i> tags would still be respected, so there would be no inconsistent behavior between CS6 and CC.  This is all speculation, of course.

                                                                       

                                                                       

                                                                      Font.fontName differs between CS6 and CC in other ways.  For example, in CS6 MSUIGothic has Font.fontName = "MS UI Gothic", whereas in CC MSUIGothic has Font.fontName = "MS UI Gothic 標準".  As I can't read Han characters, this may be style-related, but I doubt it because Font.fontStyle = "regular" (by contrast, Font.fontName = "Trebuchet MS Bold", Font.fontStyle = "bold".)

                                                                      • 33. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                                        James22s22 Community Member

                                                                        I just can't believe how there is ZERO documenation for any of this.  Flash's stylesheets have fontStyle and fontWeight properties, but they only recognize regular/italic and regular/bold respectively.

                                                                         

                                                                        This change in Flash CC completely breaks systems built in Flash CS6, and the font naming is actually arbitrary and is not a consistant combination of font name and style (e.g. "Eras ITC" family's bold font name is "Eras Bold ITC", but the bold version of Times New Roman is "Times New Roman Bold" (with Bold at the end, rather than the middle), and what's absolutely appaling is that the font name used at runtime is not exposed anywhere in the Flash IDE!!!  In the IDE you select a font family and font style independently, which is absolutely not what's used at runtime, because it actually uses a separate, arbitrarily named field in the font file for the font name. So we can't even know from within Flash what the proper runtime name is, unless we trace it out or open the font properties details tab in Windows explorer.

                                                                         

                                                                        It seems that Flash CC is always using the font "Title" that can be found in the properties of the font, NOT the font name displayed in Windows Font Preview or in Flash CC.  For example, the font name for Times New Roman Bold in Windows Font Preview is just "Times New Roman", but the font title in the properties/details tab is "Times New Roman Bold".  If they made the change to allow for specific fonts to be selected, that's fine, but it completely breaks HTML support in TextFields if it's not respecting bold and italic tags.

                                                                         

                                                                        This may actually be a trend on the web now, if you read this: http://www.smashingmagazine.com/2013/02/14/setting-weights-and-styles-at-font-face-declara tion/ , it says: "If you’ve used one of FontSquirrel’s amazing @font-face kits, then you’re familiar with this approach to setting weights and styles. The CSS provided in every kit uses a unique font-family name for each weight and style, and sets the weight and style in the @font-face declaration to normal. [...] Notice that the font-family names are unique, with each font-family name accessing the appropriate Web font files."

                                                                         

                                                                        But there's just no mention of this in any documentation I can find.  What the hell.

                                                                         

                                                                        It's also helpful to realize that font and u tags have been deprecated in HTML5, while b and i tags have been repurposed since they still retain semantic meaning apart from style: https://www.w3.org/International/questions/qa-b-and-i-tags

                                                                        • 35. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                                          Seano7200 Community Member

                                                                          I tested your file, did you ever get the default tags e.g. <b> </b> for bold to work, or did you have to stick with custom tags?  It is going to be painful to work with custom tags, but I can't seem to get it to overwrite <b> with my bold font.

                                                                          • 37. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                                            Alphayuzu Community Member

                                                                            Ohhh boy... I just noticed this Issue at my workplace... this is a HUGE bug for us because we have hundreds of files which use <b> and <i> tags for text formatting and we can't start adding any of these temporary fixes into each and every one of them every time we need to make modifications to them... we even have enitre projects which get their text from external XML files all formated with these tags...  

                                                                             

                                                                            A few people are gonna panic tomorrow...

                                                                            • 38. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                                              moloko5 Community Member

                                                                              Exactly the same problem for us - was just about to post a new discussion asking if anyone had run into this issue with <b> and <i> not working after publishing using Flash CC when I found this thread.

                                                                               

                                                                              I would say this is unbelievable but I've been working with Flash since Flash 4 days and since Adobe took over they seem to have screwed up font handling in some way with almost every single new release of Flash Pro.

                                                                               

                                                                              Unless we can find an easy workaround for this we're not going to be able to use Flash CC for any of our projects that were built in Flash CS6 - or maybe even at all.

                                                                               

                                                                              Adobe, are you even investigating this issue?

                                                                              • 39. Re: BUG - in flash pro CC, 'bold' and 'italic' properties of TextFormat have no effect on rendered text
                                                                                James22s22 Community Member

                                                                                Still no chance of me upgrading to CC, although I just found a bug in CS6 that cannot be worked around.  All versions of the "Times New Roman" font have the same font name.  Although Windows Fonts details and the font info within Flash shows them having different names such as "Times New Roman Regular", "Times New Roman Italic", they end up all being the same "Times New Roman" at runtime and conflict with each other.  For example, if you embed both the italic and regular version, export them both for actionscript with unique class names, and check the "fontName" property of both font instances at run time.... they are both just "Times New Roman".   As a result, you cannot simultaneously embed a regular and italic Times New Roman font in Flash CS6/Windows 7.  It's ridiculous.

                                                                                 

                                                                                Furthermore, if you're not using embedded fonts, and you put italic tags around some text like "3:55" and set the text field's autosize property to "left", the right side of the 5 will get clipped off as it slants outside the boundaries of the text field.  That problem doesn't occur for embedded fonts, which seems to allow autosize to work properly.

                                                                                1 2 Previous Next