4 Replies Latest reply on May 18, 2009 11:24 AM by Flex harUI

    Embed fonts in Flash CS3 and load in Flex at runtime

    nishantkyal Level 1

      Hi,

       

      I want to embed fonts in the library of Flash CS3, compile it into a SWF and load it in my flex up at runtime and register the embedded font.

       

      I'm able to get the linked class in Flex but the font doesn't show.

       

      The FLA has a font called Viner Hand embedded as a library item, with linkage VinerHand and baseclass as flash.text.Font

       

      Here's the code in flex to register the font -

       

      var FontLibrary:Class = ApplicationDomain((event.target as LoaderInfo).applicationDomain).getDefinition('VinerHand') as Class;

      Font.registerFont(FontLibrary);

       

      When I do Font.enumerateFonts after this, I see [Font VinerHand] in the array but the textField doesn't show the font embedded.

       

      Nishant