3 Replies Latest reply on Feb 12, 2008 11:36 AM by Gregory Lafrance

    Custom font for TabNavigator

    JambaJuiceAddict
      Hello,

      I'm relatively new to Flex and have a problem using a custom TTF font for tab titles.

      My Style definition in my MXML application looks like this:
      <mx:Style>
      @font-face {
      src:url("/assets/myfont.ttf");
      font-family: MyFont;
      }

      .MyFont
      {
      font-family: MyFont;
      }
      </mx:Style>

      Now, I can use this font in a Label: <mx:Label styleName="MyFont" text="Embedded fonts rock!"/>
      This works fine.

      However, I was not able to use my font in a mx:TabNavigator component for the tab titles.
      Here's the code I'm using:

      <mx:TabNavigator styleName="MyFont" id="tn">
      <mx:VBox id="vb1" label="First Tab" styleName="MyFont">
      <mx:Label styleName="MyFont" text="Embedded fonts rock!" width="100%"/>
      </mx:VBox>

      </mx:TabNavigator>

      The problem is, that the text "First Text" has the default font - not my custom one. Any ideas about this?

      Thomas