3 Replies Latest reply on Jul 8, 2009 2:01 PM by rtalton

    Effects and bold fonts

    jeremyHixon

      This is a contiuation of sorts, on another topic I posed:

       

      http://forums.adobe.com/thread/458020

       

      It seems that the problems I'm having now are that, even with the font embedded, if the font is "bold" it doesn't fade with the rest of the text.

       

      Any ideas?

        • 1. Re: Effects and bold fonts
          rtalton Level 4

          Hey Jeremy,

           

          I posted a nifty method on how to embed a font using a SWF created in Flash CS3, back in January:

          http://forums.adobe.com/message/1020117#1020117

           

          Here is an excerpt:

          For anyone else wondering how to do this, here's a brief outline on creating a SWF in Flash CS3 containing fonts you can then embed in Flex:
          In Flash, put a "dynamic text" box on the stage. I type the font name in the box to remind me which font I'm working with e.g. Verdana or Verdana Bold.
          Use one "dynamic text" box for each of your font's weight and styles (regular, bold, italic, bold italic, etc.).
          Click the embed button for EACH text box...choose the characters you need for EACH text box (uppercase, lowercase, numerals, punctuation, etc.).
          Check your publish settings, then publish to SWF.
          Add SWF to your project.
          Set up a CSS style sheet which embeds the fonts. Example:
          @font-face
          {
          fontFamily: Verdana;
          fontWeight: bold;
          fontStyle: italic;
          src: url("/assets/fonts/verdana_all.swf")
          }
          @font-face
          {
          fontFamily: Verdana;
          fontWeight: normal;
          fontStyle: italic;
          src: url("/assets/fonts/verdana_all.swf")
          }
          Make sure the fontFamily name matches the name of the font to avoid any compiler errors. The font name may differ somewhat from the name shown in some applications. In Windows you can open the font directly from the font folder by clicking it and get the exact font name.

          • 2. Re: Effects and bold fonts
            jeremyHixon Level 1

            Yes, thank you very much. Seems odd to have to state the font twice just to be able to have normal and bold, but whatever. Flex/Flash are just full of little oddities. Like stating the type of a var 2 times in some cases. Like: var grid:DataGrid = new DataGrid

             

            Very strange.

             

            But thank you very much!

            • 3. Re: Effects and bold fonts
              rtalton Level 4

              Yes, you do have to embed each weight and style separately. I think Flex requires this so that you can embed only what you need, instead of the entire font file with all its weights and styles.

               

              AS3 syntax is more like javascript or C#. So when you declare a var, you declare its type, and then create a new instance of the object (of the same type) you are assigning to the var. It's just a way of enabling type-checking so we don't screw up and try to assign a Date object to a var typed as DataGrid.