7 Replies Latest reply on Apr 17, 2007 6:04 PM by kglad

    CSS problem

    BeniRose
      I've asked a similar question before with no luck, but I recently started using StyleSheets rather than TextFormats, so I wasn't sure if there might be a new answers. I'm trying to have a textField that loads in some HTML into the htmlText field, which may contain some bold tags. However, at the same time, I am embedding fonts on this textField. When I embed fonts, none of my bold tags work. I either have to embed a bold or non-bold font. I know a work around for this is to define the bold tag in your CSS file to use the bold version of the embedded font, but then I'm stuck to only being able to bold on THAT font. This might not be an issue for now, but it might not always be this way. So my question is sort of two. Is there a way to embed two fonts so my bold tags will work on any font, and if not, is there anyway to get my bold tags to work without having to specify a seperate style just for bold?
        • 1. Re: CSS problem
          kglad Adobe Community Professional & MVP
          the primary issue is do you need or want to embed your font. if the answer is yes, you need to embed regular font and bold font and italic font, for each font type that you want to use regular, bold and italic font.
          • 2. Re: CSS problem
            BeniRose Level 1
            Yes, I do want to embed my fonts. However, it doesn't seem to let me embed more than one font per style. So, for example, if my text box has this html text assigned to it's htmlText property:

            <p>yo man. <b>how are you?</b></p>

            And the style for the p class has an embedded font that is not bold, the text that is within the b tag will still not be bold. This is true even if I declare a b class in my StyleSheet and assign the embedded font to be a bold one.

            Any help?
            • 3. Re: CSS problem
              ggshow Level 2
              create another text field
              locate it outside stage area
              select the font, & set it bold
              embed the font

              create another text field
              locate it outside stage area
              select the font, & set it italic
              embed the font
              • 4. Re: CSS problem
                BeniRose Level 1
                Can you maybe send me a movie of this working, cause I've tried it a million times, and unless you're talking about switching out text boxes depending on what fonts I need, it's never worked. Anywhere I can see this happen?
                • 5. Re: CSS problem
                  kglad Adobe Community Professional & MVP
                  if you're using css, don't use the bold tags to designate bold font. as you know, it won't work with embedded fonts. use a font style in css to designate your font, say verdanaBold.

                  then click on the upper right of your library panel, click new font, pick verdana from the dropdown, tick bold and give it an easy to find name, say _verdanaBold and click ok.

                  now find _verdanaBold in your library, right click it, click linkage, tick export for actionscript and in the id box type exactly the same name that you used to designate verdana bold in your style: verdanaBold.

                  repeat for verdanaRegular and verdanaItalic, if needed.
                  • 6. Re: CSS problem
                    BeniRose Level 1
                    wow, that worked! I've tried a million and one things, and I thought I had tried something like this before, but this html actually worked:

                    <p class='headline'>Welcome to the Breakfast Trilogy.<a class='bold'>Testing 123</a> 4?</p> and gave me a different font for the stuff in the anchor tag. However, when I defined the <b> tag in my CSS and gave it the same attributes I gave the .bold class, it didn't work. I guess I should just wrote a replace function for my html to replace any <b> and <i> tags with <a class='bold'>. Wonder how much that will screw things up if a client tries to put a bold tag inside a hyperlink! Thanks though for your continual help on this guys!
                    • 7. Re: CSS problem
                      kglad Adobe Community Professional & MVP
                      you're welcome.