1 Reply Latest reply on Dec 12, 2010 2:06 PM by Shongrunden

    Upgrade to Flex 4, Halo theme, embedded font doesn't work for Spark Label

    Stupend0us

      I'm upgrading an application to Flex 4 from Flex 3.5 using the Halo theme.  If I include a Spark Label in my application the Spark Label does not render the text using the font I defined in my CSS.  My MX Labels render fine.  Here is an example application that replicates my issue.  So,

       

      Compile and run using Spark theme.  Both Labels render the text with the correct font.

      Compile and run using Halo theme.  Only MX Label renders the text with the correct font.

       

      Is it not possible to do what I want?

       

      Thanks

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                        xmlns:s="library://ns.adobe.com/flex/spark" 
                        xmlns:mx="library://ns.adobe.com/flex/mx"
                        minWidth="250" minHeight="250">
           <fx:Style>
                @namespace mx "library://ns.adobe.com/flex/mx";
                @namespace s "library://ns.adobe.com/flex/spark";
                
                @font-face
                {
                     fontFamily: Verdana;
                     fontWeight: normal;
                     fontStyle: normal;
                     src: url("./style/fonts/verdana.ttf");
                     embedAsCFF: false;
                }
                
                @font-face
                {
                     fontFamily: VerdanaCFF;
                     fontWeight: normal;
                     fontStyle: normal;
                     src: url("./style/fonts/verdana.ttf");
                     embedAsCFF: true;
                }
                
                mx|Label
                {
                     font-family: Verdana;
                }
                
                s|Label
                {
                     font-family: VerdanaCFF;
                }
           </fx:Style>
           <fx:Declarations>
                <!-- Place non-visual elements (e.g., services, value objects) here -->
           </fx:Declarations>
           <s:VGroup>
                <mx:Label text="My text" />
                <s:Label text="My text" />          
           </s:VGroup>
      </mx:Application>