0 Replies Latest reply on May 22, 2010 2:27 PM by real_ideveloper

    Setting font family in Spark TextArea

    real_ideveloper

      Hi all.

       

      Today i loaded the flex sdk 4.0.0.14159 (open source) to try the spark text area component.

      Allthing seems to be allright for my purposes but i can not set the font family.

       

      My css-file:

      @font-face {
      
              src: url("Families/verdana.ttf");
      
              fontFamily: Verdana;
      
              embedAsCFF: true;
      
              }
      
      @font-face {
      
              src: url("Families/TIMES.TTF");
      
              fontFamily: TimesNewRoman;
      
              embedAsCFF: true;
      
              }
      

       

       

      #########

       

      an my as3 snippet file:

       

      var txtLtFrmt:TextLayoutFormat = new TextLayoutFormat();
      txtLtFrmt.color = 0x00FF0000;
      txtLtFrmt.fontFamily = (fontCmbBox.selectedItem as Object).normal;
      txtLtFrmt.fontLookup = "embeddedCFF";
                 
      myTextArea.setFormatOfRange(txtLtFrmt,0,myTextArea.text.length);
      

       


      The text color changes but not the font family.

       

      Can anybody help me to solve this problem.