0 Replies Latest reply on Sep 23, 2009 1:44 AM by Javinto

    Embedded font not working in Spark Label control?

    Javinto Level 1

      Hi,

       

      I'm trying to use embedded fonts with the Spark Label (formerly SimpleText) control. I'm using SDK 4 build 10485 now, but I could not manage it in Beta 1 neither.

       

      I'v been playing with cff: true/false, embedAsCFF:true/false but no results.

       

      I've added my test application where it does work with the Halo <mx:Label> control, but not with the Spark <s:Label> control.

       

      So, no compiler errors, but the Spark label control shows a serif (Helvetia?) font where it should be sans as does the Halo control.

       

       

      Can anybody help me out here?

       

       

      Thanks

       

      Jan

       

       

      As I get the message 'the content type of this attachment is not allowed' on uploading the MXML file, here is the code:

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/halo"
          minWidth="1014" minHeight="768"
          backgroundColor="#7B7374">

       

          <s:layout>
              <s:VerticalLayout paddingBottom="8" paddingLeft="8" paddingRight="8" paddingTop="8" />
          </s:layout>

       

          <fx:Style>
              @namespace mx "library://ns.adobe.com/flex/halo";
              @namespace s "library://ns.adobe.com/flex/spark";

       

              @font-face {
                  src: url("project/assets/thesans/THSP____.TTF");
                  fontFamily: HaloSans;
                  fontWeight: normal;
                  advancedAntiAliasing: true;
                  unicode-range: U+0021-U+007B;
              }

       

              @font-face {
                  src: url("project/assets/thesans/THSP____.TTF");
                  fontFamily: SparkSans;
                  fontWeight: normal;
                  advancedAntiAliasing: true;
                  unicode-range: U+0021-U+007B;
                  embedAsCFF: true;
              }

       

              .mySparkSans {
                  fontFamily: SparkSans;
                  fontSize: 24;
              }
              .myHaloSans {
                  fontFamily: HaloSans;
                  fontSize: 24;
              }

       

          </fx:Style>
         
          <s:SkinnableContainer>
              <s:Label styleName="mySparkSans" text="This should be TheSans but it is not...., notice the characters 'ag'"/>
              <mx:Label styleName="myHaloSans" text="This is TheSans, notice the characters 'ag'" top="100"/>
          </s:SkinnableContainer>

       

      </s:Application>