4 Replies Latest reply on Apr 1, 2008 12:45 PM by TessandraFae

    Embedding .swf font Success?

    Kevin K.
      Has anybody had any success whatsover using style declarations in order to embed fonts into a Flex application? I've found a few posts (on this forum, even) but no consensus THAT IT HAS EVER WORKED.

      If people have had success, can you please share your process? I have experience with sIFR 1/2/3, using Flash fonts, etc. Here is my style declarations.

      @font-face {
      src:url("interstate.swf");
      fontFamily: "Interstate";
      }

      @font-face {
      src:url("interstate.swf");
      fontFamily: "Interstate";
      fontWeight: bold;
      }
        • 1. Re: Embedding .swf font Success?
          rkschulz
          Works for me. Well, sort of. Fonts renders fine on screen and prints ok(ish) from Windows, but printing from Mac is completely unreadable.

          I created the swf creation for the fonts I need using the "procedure" on page 651 of the dev guide. The make sure you embedded them as a style somewhere higher up in your UI tree so the styles cascade down and then it just works.

          Example:

          In parent.mxml:

          <mx:Style>
          @font-face {
          src: url("/font/Fonts.swf");
          fontFamily: "Font Name";
          }

          .printFont5 {
          fontFamily:"Font Name";
          fontSize:5;
          }
          </mx:Style>

          In a UI component that is a child or parent.mxml

          <mx:Label ... styleName="printFont5"/>

          All works well.

          As I said, the only problem that I have is that it won't print on Mac (looks fine on screen and looks good and prints from Windows).


          Robert.
          • 2. Re: Embedding .swf font Success?
            Kevin K. Level 1
            Yes. I have done all that. I couldn't care less about printing at this point - would like to get past errors.

            Would anyone care to share a font.swf file so I can give it a shot? I've tried Interstate (Type 1), Helvetica Nueue, Helvetica, and even fr**!@#% Arial on my Mac in Flash 8 to no avail.

            Each time:

            font 'myFont' with normal weight and regular style not found
            • 3. Re: Embedding .swf font Success?
              Pascal L.
              Hi,

              I Agree with Robert, it works fine, with embed fonts, in this way, but only in this way.
              I explain :

              I used exactly the same method to embed my proprieraty font, but when I want to use it in a htmlText like this :

              <mx:Style>
              @font-face {
              src:url("../../../../fonts/NUP-NORM.TTF");
              fontFamily:"NuP";
              }

              .MyTextStyle
              {
              fontFamily:"NuP";
              fontSize: 12pt;
              }
              </mx:Style>

              <mx:Text width="100%" id="ta2">
              <mx:htmlText>
              <![CDATA[This is a picto : <font face="NuP" size="18">T</font>]]>
              </mx:htmlText>
              </mx:Text>

              It doesn't show up my font, unless it's windows installed.

              Any tips ?