0 Replies Latest reply on Sep 26, 2011 3:59 AM by Santanu Karar

    Problem embedding fonts with ButtonSkin class with SDK 4.5.1

    Santanu Karar Level 1

      Hi,

       

      I've an external style file calling into main mobile application which has codes something like these:

       

      @font-face {

                src: url("../fonts/TektonPro-BoldCond.otf");

        fontFamily: TektonProBCnd;

        embedAsCFF: false;

      }

       

      .buttonStyle {

        embedFonts: true;

        fontFamily: TektonProBCnd;

        fontSize: 24;

        skin: ClassReference(null);

      }

       

      .text_listMediumText {

        fontFamily: TektonProBCnd;

        fontSize: 24;

                color:                               #666666;

      }

       

      In my application the embedding font styles working properly when directly bind with any component with 'styleName' property (i.e. text_listMediumText). I've also one button something like this:

       

      <s:Button label="CONNECT" skinClass="actionScripts.ui.SketchButtonSkin" click="onConnect()"/>

       

      And the skin class is as follows:

       

      public class SketchButtonSkin extends ButtonSkin

                {

       

        //--------------------------------------------------------------------------

                          //

        //  PRIVATE VARIABLES

                          //

        //--------------------------------------------------------------------------

       

       

        /**

                           * CONSTRUCTOR

                           */

                          public function SketchButtonSkin()

                          {

                                    super();

                                    width = 268;

                                    height = 50;

                          }

       

       

        //--------------------------------------------------------------------------

                          //

        //  OVERRIDDEN API

                          //

        //--------------------------------------------------------------------------

       

        // Override this function to prvent the button from drawing a background

                          override protected function drawBackground(unscaledWidth:Number,

                                                                                                                                 unscaledHeight:Number):void{

       

                          }

       

        override protected function

                                    labelDisplay_valueCommitHandler(event:FlexEvent):void

                          {

       

                                    labelDisplay.setStyle( "fontSize", 20 );

                     labelDisplay.setStyle("fontFamily","TektonProBCnd"); // or, labelDisplay.styleDeclaration = styleManager.getStyleDeclaration(".buttonStyle");

                          }

           }
      }

       

       

      But I not ever could embed the font with this buttonSkin class. Any help please (?)