2 Replies Latest reply on Aug 10, 2009 10:01 AM by Flex harUI

    Why do CFF fonts not work on the mx.Panel's title?

    cdman522 Level 1

      Hi all,

       

      I'm working on a project with a halo panel mixed in with the newer spark components. I'm trying to use the CFF embeded fonts with everything. The mx.Label and s.SimpleText components are working fine. The mx.Panel however, doesn't display it's Title when I set the textFieldClass to mx.core.UITLFTextField.

       

      Am I doing something wrong or is this a bug?

       

       

      Here is the code to add to a Web/AIR app. Also you will need to create a fonts/times folder in the project root and add your system times new roman fonts to it. Or use the project I am attaching.


         
          <mx:Panel title="This is a test of the fonts" width="100%" height="100%">
              <mx:Label text="here is a label" x="50" y="50"/>
              <s:Group x="50" y="150" width="300" height="100" >
                  <s:SimpleText text="here is simple text" />   
              </s:Group>
             
          </mx:Panel>
         
          <fx:Style>       
              @namespace s "library://ns.adobe.com/flex/spark";
              @namespace mx "library://ns.adobe.com/flex/halo";
             
              /** Define the font used the Virtual Labs **/
              /*Normal*/
              @font-face {
                  src: url("../fonts/times/TIMES.TTF");
                  fontFamily: "enFont";
                  fontStyle: normal;
                  fontWeight: normal;
                  embedAsCFF: true;
                  unicodeRange: "U+0021-U+007E,U+0095,U+0099,U+00A9,U+00AD,U+00AE,U+00AF,U+00B0,U+00B1,U+00B9,U+00B2,U+00 B3,U+2014,U+2022,U+2070-U+208E,U+2103,U+2109,U+212A";
              }
              /*Bold*/
              @font-face {
                  src: url("../fonts/times/TIMESBD.TTF");
                  fontFamily: "enFont";
                  fontStyle: normal;
                  fontWeight: bold;
                  embedAsCFF: true;
                  unicodeRange: "U+0021-U+007E,U+0095,U+0099,U+00A9,U+00AD,U+00AE,U+00AF,U+00B0,U+00B1,U+00B9,U+00B2,U+00 B3,U+2014,U+2022,U+2070-U+208E,U+2103,U+2109,U+212A";
              }
              /*Italicized*/
              @font-face {
                  src: url("../fonts/times/TIMESI.TTF");
                  fontFamily: "enFont";
                  fontStyle: italic;
                  fontWeight: normal;
                  embedAsCFF: true;
                  unicodeRange: "U+0021-U+007E,U+0095,U+0099,U+00A9,U+00AD,U+00AE,U+00AF,U+00B0,U+00B1,U+00B9,U+00B2,U+00 B3,U+2014,U+2022,U+2070-U+208E,U+2103,U+2109,U+212A";
              }
              /*Bold-Italicized*/
              @font-face {
                  src: url("../fonts/times/TIMESBI.TTF");
                  fontFamily: "enFont";
                  fontStyle: italic;
                  fontWeight: bold;
                  embedAsCFF: true;
                  unicodeRange: "U+0021-U+007E,U+0095,U+0099,U+00A9,U+00AD,U+00AE,U+00AF,U+00B0,U+00B1,U+00B9,U+00B2,U+00 B3,U+2014,U+2022,U+2070-U+208E,U+2103,U+2109,U+212A";
              }
             
              /** These are primarily for the admin tool. **/
              mx|Label, mx|Panel
              {
                  fontFamily: "enFont";
                  fontSize: 18;
                  fontWeight: bold;
                  fontLookup: embeddedCFF;
                  textFieldClass: ClassReference("mx.core.UITLFTextField");
              }
          </fx:Style>