3 Replies Latest reply: Jun 24, 2011 1:39 AM by Designscripting RSS

    Embedded font and Combobox

    Vikram_S Community Member

      Hello All,

       

      Scenario of my application: Application have combobox filled with fonts list. When user select font from combobox. Application load font swf from server and apply to text.

       

      I have embedded fonts in SWF using css.

      @font-face {   

          src: url("assets/fonts/arial.ttf");   
          fontFamily: "Arial";   
          fontWeight: "normal";   
          embedAsCFF: true;   
      }

       

      here is code snippet to load font from server.

       

      var eventDesi:IEventDispatcher = styleManager.loadStyleDeclarations2(fontStyleName.@swfURL);
                  eventDesi.addEventListener(StyleEvent.ERROR,function(event:StyleEvent):void{
                      Alert.show("error while downloading font " + fontStyleName.@name);
                  })
                  eventDesi.addEventListener(StyleEvent.COMPLETE,function(event:StyleEvent):void{
                      fontStyleName.@isDownloaded == "true";
                     if(functionToCall != null)
                          functionToCall.call();   
                  })

       

      Problem:

      When I select font arial form combobox all list of fonts,tool tips are get disappear. My primary exploration is combobox has arial font and I am loading again arial and registering it. This may be the cause.

       

      Is there any way to set embeded font to any control?

       

      Thanks,

      Vikram