Skip to main content
March 20, 2009
Question

Faux bold doesn't work in CS4

  • March 20, 2009
  • 12 replies
  • 7670 views
In CS3, I can create a clip with 2 dynamic text fields - fld1 is say, Myriad Pro and fld2 is Myriad Pro with faux bold turned on from the properties panel. I can then do...

fld1.htmlText = <b>Bold text</b>

and fld1 text appears in bold text because the faux bold font was embedded in fld2.

CS4 doesn't have a faux bold, and when I go to the text menu and choose bold, it doesn't faux bold fld2, it actually changes the text to Myriad Pro Bold. The bold tag no longer works, neither does the strong tag. I can, however, use font face tag and set it to Myriad Pro Bold, and now fld1 will show up bold.

Now let's say I want to put all my text content in an external XML file so the client can update it and I don't want to have to explain the inner workings of Flash and tell them that they can't use the bold tag, they have to use the font face tag and set it to some random name that I come up with for the bold font library symbol (in case we don't want to use Myriad in the future).

Do I really have to set up a function to examine strings for the bold tag and replace it with the font face tag? Is there really no way to get the bold tag to work?
This topic has been closed for replies.

12 replies

Participating Frequently
October 21, 2009

Hi Rothrock, no I've got a Dynamic Text Field on the stage and am populating it with HTML from a Database/XML file.
You can see my test files attached to the message dated Jul 22, 2009. They show it working no worries in the SWF's created using CS3 but not working in the SWF's created using CS4.

Participant
September 30, 2010

Great, Rothrock, thanks a lot, that solved it for me!

(i had a dynamic textfield placed on stage manually and a movieclip with a textfield nested inside. both hab the problem with myriad pro showing neitherbold nor italic.)

Cheers, sebomoto!

Participating Frequently
October 20, 2009

Well the, latest, after around 3 months, Adobe has said that it's a known bug (with the Mac version it seems). So now it's time to wait until they get around to fixing it. If it took them 3 months just to tell me it's a known bug, I don't want to imagine how long it's going to fix it. Such a big bug... surely there would be a lot of others trying to use HTML text including bold tags in text fields?

Inspiring
October 21, 2009

I didn't read all of this, but I've recently discovered something that seems to maybe be related.

Are your textfields created with code or are they timeline placed?

I found that if my textfields are timeline placed and if I have the "auto kern" check box ticked that my bolds seem to disappear. Unticking "auto kern" fixed it for me.

Don't know if that will help you. And sorry if I'm off the point, but I just couldn't face all the thread.

Participant
November 3, 2009

Rothrock,

Thanks for the tip!  This worked for me!

Previously, my Bold dynamic text fields were going to Times New Roman, just as described in this thread.

August 26, 2009

Thanks Paul,

I did try that with the same results.  Originally my code was in AS2, but your AS3 code outputs the same results.  I am pretty sure my html/css file is not doing anythign crazy.   I did attach a .fla so you can see the actual html file Im loading, in addition to the html tags embeded within flash.

--sorry for duplicating posts some reason it wont let me upload .fla files, I didnt think my post got posted since it threw weird error message for me after i hit submit

Message was edited by: prabug

August 26, 2009

Thanks Paul,

I did try that with the same results.  Originally my code was in AS2, but your AS3 code outputs the same results.  I am pretty sure my html/css file is not doing anythign crazy.   I did attach a .fla so you can see the actual html file Im loading, in addition to the html tags embeded within flash.

August 26, 2009

Well the faux bold and faux italic is not working now, like it did before in all other versions of flash.  You never needed to embed two different fonts, just one and only if you dont use a common system font.  It would read and render html bold tag just fine on all fonts with or without embedding anything.

Participating Frequently
August 26, 2009

Hi prabug, The faux fonts are working. They are available if there is no actual bold and italic face available. If a bold and italic version are available they are greyed out. You still only need to embed a font if it is not a system font.

August 26, 2009

I tried what you suggested, as this was an old issue, but am sure I will  run into it again.  And what I found out, that it does work when you are not loading an external html file, which for me at least defeats the purpose.  It did work when html is coded wihtin flash. i.e.

textbox.htmlText = "<b>this is bold</b>";

this work, but not practical, as I still have to go inside flash and edit, and republish andI have to do it for the clients as opposed them updating it themseleves.

but using loadVars to load external html files it doesnt work


var loadHtml:LoadVars = new LoadVars();

var flash_css = new TextField.StyleSheet();

init();

function init(){       
        flash_css.load("../css/main.css");
        flash_css.onLoad = function(success:Boolean) {
            if (success) {
                myText.styleSheet = flash_css;
                loadHtml.onData = function(html:String):Void  {
                    myText.html = true;
                    myText.htmlText = unescape(html);
                };
            } else {
                myText.htmlText = "Could not load CSS stylesheet.";
            }

        };

        loadHtml.load("../staging/cbrbcf/html/test.html");
}


working.htmlText = "<b>bold</b> is working here only";

Am I doing something wrong in the way im loading my external html files?

  My css file only makes reference to anchor links, and effects nothing else.

Participating Frequently
August 26, 2009

Thanks very much Paul for taking the time to explain your solution. I've opened your SWF with Myriad Pro disabled and enabled, and when disabled, Myriad Pro seems to be working fine, just the bold doesn't show. With Myriad enabled, everything looks fine.I've attached my screen grabs.

I guess one of my biggest complaints is simply that what used to work in CS3 no longer does. Hopefully I don't need to re-work the flash for sites that I've already built when I need to make edits in them using CS4. Cheers again for taking the time. Munkeeboy.

Participating Frequently
August 26, 2009

Hi monkeeboy

Wow, this has had me really thinking hard and doing a lot of testing and I think I have the answer.

Believe it or not my posted example is actually working. That said, there is an issue.

The way Flash renders the bold version of the font is almost imperceptible. You can see this if you zoom in on the Flash file in the Flash Player.

I also tested it with the italic face and it works fine and is much clearer to see. In the images you posted it is also working but looks more like the font is a slightly different color, as I said almost imperceptible.

I have added 2 screen grabs below (both taken with the font turned off in the system), one with the swf at its normal size and the other zoomed in by control clicking on the swf and selecting zoom in. It is quite clear in the zoomed in one that Flash is using the corect versions of the font and they are being correctly accessed in HTMLtext using <b> and <i>. However, I agree, the way Flash renders the bold face is not bold enough and also not consistent.

So the problem really is the way Flash renders embedded fonts, especially bold faces. I have realised this is more of a problem than I thought as I did a test and found it varies a lot.

If you create a static text field using the embedded bold font, a static text field using the bold face without embedding the font, and using the method I described earlier, the rendered weight is different every time. This is something I am going back to the team with to look at.

One thing that might help you int the future is that with Flash Player 10 we have included a seperate and new text engine that is based on the Adobe text engine found in apps like InDesign. This is finally a trully high end text engine that supports a huge list of features and renders beautifully. To access it currently in Flash CS4 you have to use ActinScript, however on Labs, we have added a beta version of the Text Layout Framework component - http://labs.adobe.com/technologies/textlayout/  This provides an interface in Flash to implement the new feature.

Cheers

Participating Frequently
August 26, 2009

Following Paul B.'s advice, I can get it to preview perfectly, but as soon as I disable the font in the system and open the SWF with the Flash Player, the font defaults to Times New Roman. I really don't understand how this will work with Adobe's new approach in CS4 where the font family is used instead of the previous Bold and Italics buttons. There seems no way to tell Flash that the "Futura Bold" is to be used to display bold tags. I opened a case with Adobe a month ago about this and they are still working on a solution. They keep telling me they will call me back on the day after briefly talking to me, then they call me back days later, saying the person working on the case didn't realise they wouldn't be working later in the day. If they get a solution back to me, I'm going to post it up here. I've also attached my example FLA.

Participating Frequently
August 26, 2009

Hi munkeeboy

I can understand you are frustrated with this so I will explain in more detail. I have just followed exactly what you said in your post ie turning off the font and it works perfectly fine on my machine with the file I have built. I will attach both the fla and swf so you can see what I have done. In my case I am using Myriad Pro in both the regular and bold faces.

Earlier in this thread (and in fact in the title of the thread) is says that faus bold and faux italic won't work with Myriad Pro. This is because Myriad Pro has both bold and an italic faces available. If you choose Myriad Pro or many other fonts, if they have bold and italic available the option to add a faux bold or faux italic is greyed out.

If the font you choose does not have an available bold or italic face then Flash will allow you to add a faux version.

If you follow my example file both the regular and bold faces are available in the Flash file and will be accessed by normal HTML text without ANY workarounds. (The same goes for italic if you want to add that as well).

There are NO bugs here. It works exactly as expected.

Hope this helps.

Update - I have just seen what you are doing wrong. You are not exporting the library fonts in your file. Control click the font in the Library and select Properties. Under Linkage, select Export for ActionScript. This will embed the font in your swf file. Library items will not be exported in a swf file unless they are referenced on the timeline or exported for Actionscript.

Participating Frequently
August 26, 2009

Hey Greg

All you need to do is embed both the regular and bold version of Myriad Pro in your Library and it will work fine.

Just set your text field to use the embedded regular version and <b> tags will work fine. See the attached file.

If you only want to embed certain glyphs you can use the [Embed()] tag and specify the unicodeRange/s you want.

Participant
July 23, 2009

You can do it!

Edit -> Keyboard Shortcuts

Text -> Style -> Faux Bold   remapping Ctrl+Shift+B

Text -> Style -> Faux Italic  remapping Ctrl+Shift+I


select TextField and Ctrl+Shift+B.

July 23, 2009

I did find another way without any scripts.  You still have to embed your two fonts, one regular, and the other bold, and give them linkage name.  Now within your html file, the words you want in bold, can be called by using the font tag, and the face attribute.  Within the face attribute, you can use the linkage id of the font you embeded in your library.

Ex.

<font face="Font1">This is not bold</font><font face="Font2">This is bold.</font>

Where, Font1 has the regular weight font, and Font2 has the bolded font.  Took way too long for me to find a workaround, Hopefully it will be back to using bold tags in the next version of Flash