Run this code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" backgroundGradientColors="[#ffffff, #ffffff]">
<mx:Style>
.noEmbed{
fontFamily: Verdana;
fontSize: 14;
}
.embed1 {
fontFamily: myVerdanaFont;
fontSize: 14;
}
.embed2 {
fontFamily: myVerdanaFont2;
fontSize: 14;
}
</mx:Style>
<mx:ComboBox x="70" y="172" id="noEmbed"
dataProvider="['item1', 'item2', 'item3']" styleName="noEmbed" />
<mx:ComboBox x="280" y="172" id="Embed"
dataProvider="['item1', 'item2', 'item3']" styleName="embed1"/>
<mx:ComboBox x="458" y="172" id="Embed1"
dataProvider="['item1', 'item2', 'item3']" styleName="embed2"/>
<mx:Label x="280" y="123" text="embedded normal font"/>
<mx:Label x="70" y="123" text="non-embedded font"/>
<mx:Label x="458" y="123" text="embedded BOLD font"/>
<mx:Script >
<![CDATA[
[Embed(source='resources/verdana.ttf',
fontWeight='normal',
fontName='myVerdanaFont',
mimeType='application/x-font' ,
flashType='true'
)]
private var font1:Class;
[Embed(source='resources/verdanab.ttf',
fontWeight='bold',
fontName='myVerdanaFont2',
mimeType='application/x-font'
)]
private var font2:Class;
]]>
</mx:Script>
</mx:Application>
--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> It was or is? The CB defaults to bold in the label, non-bold in the
> dropdown. Depending on how you applied this style decl, I would
have
> expected the CB to be non-bold in both places.
>
>
>
> When you embed a font, you have to embed both font files (bold and
> normal) for a CB or other scenario like that.
>
>
>
> Cam you strip it down to a simple test case?
>
>
>
> ________________________________
>
> From: [email protected]
[mailto:[EMAIL PROTECTED] On
> Behalf Of Jeff Schuenke
> Sent: Monday, September 10, 2007 8:21 AM
> To: [email protected]
> Subject: [flexcoders] Re: font in comboBox and Title not the same
>
>
>
> It was as bold. I did not specify this myself, it must be the
default
> style.
>
> I find that if I don't use the embeded font it works correctly. So
> it seems that the componenet is somehow using the normal and bold
> version of the local font correctly. I think that using an embedded
> font that is either normal or bold fails for both area since one or
> the other weight is missing.
>
> --- In [email protected] <mailto:flexcoders%
40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > I just noticed you set fontStyle in the declarations. In the
> original
> > problem, did the CB's label show as normal or bold?
> >
> > ________________________________
> >
> > From: [email protected] <mailto:flexcoders%
40yahoogroups.com>
>
> [mailto:[email protected] <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of Jeff Schuenke
> > Sent: Friday, September 07, 2007 12:41 PM
> > To: [email protected] <mailto:flexcoders%
40yahoogroups.com>
> > Subject: [flexcoders] Re: font in comboBox and Title not the same
> >
> >
> >
> > If I switch the main style to the bold font, then the label is
> > rendered correctly, but the items in the list are now wrong!
> >
> > How can I set a style that works for both??
> > Jeff
> > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%
> 40yahoogroups.com>
> > , "Alex Harui" <aharui@> wrote:
> > >
> > > The CB label is usually in Bold isn't it? You have to embed a
> bold
> > font
> > > as well.
> > >
> > > ________________________________
> > >
> > > From: [email protected]
> <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%
> 40yahoogroups.com>
> >
> > [mailto:[email protected]
> <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%
> 40yahoogroups.com>
> > ] On
> > > Behalf Of Jeff Schuenke
> > > Sent: Friday, September 07, 2007 8:59 AM
> > > To: [email protected] <mailto:flexcoders%
40yahoogroups.com>
> <mailto:flexcoders%
> 40yahoogroups.com>
> > > Subject: [flexcoders] Re: font in comboBox and Title not the
same
> > >
> > >
> > >
> > > .zoomStyle{
> > > right: 10;
> > > bottom: 10;
> > > padding-right: 10;
> > > fontFamily: myVerdanaFont;
> > > fontSize: 12;
> > > fontStyle: normal;
> > > kerning: true;
> > > }
> > >
> > > where myVerdanaFont is embedded as follows:
> > > [Embed(source='resources/verdana.ttf',
> > > fontWeight='normal',
> > > fontName='myVerdanaFont',
> > > mimeType='application/x-font',
> > > flashType='true'
> > > )]
> > > private var font1:Class;
> > >
> > > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com>
> > <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%
> > 40yahoogroups.com>
> > > , "Alex Harui" <aharui@> wrote:
> > > >
> > > > What does the stylesheet look like?
> > > >
> > > > ________________________________
> > > >
> > > > From: [email protected]
> <mailto:flexcoders%40yahoogroups.com>
> > <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%
> > 40yahoogroups.com>
> > >
> > > [mailto:[email protected]
> <mailto:flexcoders%40yahoogroups.com>
> > <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%
> > 40yahoogroups.com>
> > > ] On
> > > > Behalf Of Jeff Schuenke
> > > > Sent: Friday, September 07, 2007 7:56 AM
> > > > To: [email protected]
> <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%
> 40yahoogroups.com>
> > <mailto:flexcoders%
> > 40yahoogroups.com>
> > > > Subject: [flexcoders] font in comboBox and Title not the same
> > > >
> > > >
> > > >
> > > > I have set the font for a comboBox using a styleSheet. The
font
> > in
> > > the
> > > > drop list changes but not the font displayed as a label. You
> can
> > > see
> > > > this here <http://www.miragevideo.com/sample.gif
> <http://www.miragevideo.com/sample.gif>
> > <http://www.miragevideo.com/sample.gif
> <http://www.miragevideo.com/sample.gif> >
> > > <http://www.miragevideo.com/sample.gif
> <http://www.miragevideo.com/sample.gif>
> > <http://www.miragevideo.com/sample.gif
> <http://www.miragevideo.com/sample.gif> > > >
> > > >
> > > > How can I set the font for the label as well?
> > > >
> > > > thanks,
> > > >
> > > > Jeff
> > > >
> > >
> >
>