1 Reply Latest reply on Oct 14, 2010 2:39 PM by jrowny

    Font embedding for TLF in flex4

    MageshR Level 1

      Hi - We are in the situation where in embedded fonts are not working for TLF. We embed the fonts in the css file with embedAsCFF as false. It shows the fonts fine in the mx combobox component but not in TLF.

       

      We tried to do a AS way of embeding font as below in the initial mxml, so that it gets available when textregion is created dynamically.
                  [Embed(source="/assets/fonts/font1.ttf", mimeType="application/x-font-truetype", fontName="CrownRoman",
                  embedAsCFF="true")]
                  public static const font1:Class;

       

      and Font.registerFont(font1);

       

      But this is not helping either. Fonts are not getting embedded.

       

      I tried to use(as explained in one of the solutions in the internet)

        var uic:UIComponent = UIComponent(FlexGlobals.topLevelApplication);
        textFlow.flowComposer.swfContext = ISWFContext(uic.getFontContext(textLayoutFormat.fontFamily, false, false, true));

       

      but it gives me complier error  "Attempted access of inaccessible method getFontContext through a reference with static type mx.core:UIComponent"

       

      Pls help me in solving this. Its very critical. Any help is appreciated. Can anyone share some example.

       

      Let me know if you need more details.