Hi Bjorn

I just tried this with a custom panel at it worked ok:

// CustomPanel
package {
        import mx.containers.Panel;
    public class CustomPanel extends Panel {    
        public function CustomPanel() {
            super();
        }
        override protected function updateDisplayList
(unscaledWidth:Number,unscaledHeight:Number):void {
            super.updateDisplayList(unscaledWidth, unscaledHeight);
            setStyle("headerHeight",30);            
            //title="This is one very long title";
            titleTextField.width = 200;
            titleTextField.height = 50;
            titleTextField.styleName="digitalclock";            
            titleTextField.text = "Hello embedded font";
            titleTextField.wordWrap = true;
        }

    }
}

// main.css
@font-face {
        src: url("file:///c:/winnt/fonts/quartzitalic.ttf");
        font-style:italic;
        fontFamily: clocky;
 }
.digitalclock {
        color: #99CCFF;
        font-size:20;
        font-style: italic;
        font-family: clocky;
}

Hope this helps.
Cheers
Wayne


--- In [email protected], "Bjorn Schultheiss" 
<[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> Is it possible to apply an embedded font to a Panel's title via 
CSS?
> 
> Here's the simplest example I could create
> 
> [Main (PanelTitleFontCSS.mxml)]
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
layout="absolute"
> xmlns:my="*">
> <my:MyPanel />
> </mx:Application>
> 
> [Panel (MyPanel.mxml)]
> <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"; 
layout="absolute"
> title="Panel Title" styleName="myFontStyle">
> <mx:Style source="MyStyle.css" />
> <mx:Label text="Some text" />
> </mx:Panel>
> 
> [CSS (MyStyle.css)]
> @font-face
> {
> fontFamily: myMyriadProBlack;
> fontWeight: heavy;
> src:url("MYRIADPB.TTF");
> }
> .myFontStyle
> {
> fontFamily: myMyriadProBlack;
> fontWeight: heavy;
> fontSize: 26; 
> }
> 
> In this example the label within the panel has the font applied.
> The Panel header is TimesRoman or something :(
> 
> Regards,
> 
> Bjorn Schultheiss
> Senior Flash Developer
> 
> QDC
> Personalised Communication Power
> 
> Level 2, 31 Coventry St.
> South Melbourne
> 3205, VIC Australia
> 
> T: +61 3 9674 7400
> F: +61 3 9645 9160
> W: http://www.qdc.net.au
> 
> ((------------This transmission is confidential and intended 
solely for the
> person or organization to whom it is addressed. It may contain 
privileged
> and confidential information. If you are not the intended 
recipient, you
> should not copy, distribute or take any action in reliance on it. 
If you
> believe you received this transmission in error, please notify the
> sender.---------------))
>



Reply via email to