Skip to main content
August 10, 2009
Question

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

  • August 10, 2009
  • 1 reply
  • 756 views

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>       
        @11909012 s "library://ns.adobe.com/flex/spark";
        @11909012 mx "library://ns.adobe.com/flex/halo";
       
        /** Define the font used the Virtual Labs **/
        /*Normal*/
        @11220649-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+00B3,U+2014,U+2022,U+2070-U+208E,U+2103,U+2109,U+212A";
        }
        /*Bold*/
        @11220649-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+00B3,U+2014,U+2022,U+2070-U+208E,U+2103,U+2109,U+212A";
        }
        /*Italicized*/
        @11220649-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+00B3,U+2014,U+2022,U+2070-U+208E,U+2103,U+2109,U+212A";
        }
        /*Bold-Italicized*/
        @11220649-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+00B3,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>

This topic has been closed for replies.

1 reply

Peter_deHaan
Participating Frequently
August 11, 2009

cdman,

I believe this is a bug. This was filed recently http://bugs.adobe.com/jira/browse/SDK-22627 (and from the looks of it, you filed it. Thanks!)

I wasn't able to find a workaround (apart from switching to the Spark Panel container, if that is an option), but the bug is sitting in the internal review board queue and hopefully will be assigned out to a dev shortly.

Peter