6 Replies Latest reply on May 26, 2011 11:31 PM by Flex harUI

    Font style/font weight Not Working with embedded fonts using TLF

    jaishy Level 1



      i'm using as3 and want to use embedded fonts by compiling the swf. For text Engine i'm using TLF(SDK 4.1, player 10.1). Every thing seems to be fine but when i'm trying to give the "font styles" and "font weight" properties to the text at as3 level or at swf level, it does'nt work, the text comes out properly but without these properties. whatever font i'm embeding is all available on my machine. here is the code i'm using at runtime....please help !


      //swf compile code:


          import flash.display.Sprite;
      import flashx.textLayout.compose.ISWFContext;
      public class Slide1 extends Sprite implements ISWFContext
              [Embed(source="C:/WINDOWS/FONTS/Abbey-Medium-Extended.ttf", fontName="Abbey Medium Extended",
                      embedAsCFF = "true", unicodeRange="U+0041,U+0062,U+0065,U+0079,U+0020,U+006D,U+0064,U+0069,U+0075",
              public static const abbey_medium_extended:Class;
              [Embed("slide1/sldBg1.png", mimeType="image/png")]
              public static const bg:Class;
              [Embed("slide1/slide1.xml", mimeType="application/octet-stream")]
              public static const slide:Class;
              public function callInContext(fn:Function, thisArg:Object, argsArray:Array, returns:Boolean=true):*{


                   if (returns)


                           return fn.apply(thisArg, argsArray);


                   fn.apply(thisArg, argsArray);


      //TLF (textFlow obj) code using TestLayoutFormat object(charFormat):


      var fontClass:Class = embedClass as Class;
                      if(fontList.length > 0){
                          textFlow.flowComposer.swfContext = new fontClass();




      charFormat.fontLookup = flash.text.engine.FontLookup.EMBEDDED_CFF;
                                              charFormat.renderingMode = flash.text.engine.RenderingMode.CFF;