您的位置:首页 > Web前端 > CSS

FLEX4中如何通过textFiledClass样式给Halo/MXlist设置CFF/DefineFont4字体的例子

2011-09-16 15:40 239 查看
转载的代码,本人也是刚刚入门,所以添加不上解释,望有高手可以添加一下注释以供学习接下来的例子演示了Flex 4中如何通过textFieldClass样式设置mx.core.UIFTETextField类,给Halo/MX List设置CFF/DefineFont4字体。

<?xmlversion="1.0"encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2009/11/17/using-a-cff-embedded-font-with-a-halo-list-control-in-flex-4/ -->
<s:Application name="Halo_List_textFieldClass_test"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo">
<s:controlBarContent>
<s:Label id="sdkVer"
fontFamily="df4ster"
fontSize="24"
initialize="sdkVer.text = mx_internal::VERSION;" />
</s:controlBarContent>

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

@font-face {
src: url("C:/Windows/Fonts/Arial.ttf");
embedAsCFF: true;
fontFamily: df4ster;
}

mx|List {
color: red;
fontFamily: df4ster;
fontSize: 16;
textFieldClass: ClassReference("mx.core.UIFTETextField");
}
</fx:Style>

<mx:List id="lst"
width="200"
horizontalCenter="0" verticalCenter="0">
<mx:dataProvider>
<mx:ArrayList>
<fx:Object label="Button"icon="@Embed('assets/Button.png')"/>

<fx:Object label="ButtonBar"icon="@Embed('assets/ButtonBar.png')"/>

<fx:Object label="CheckBox"icon="@Embed('assets/CheckBox.png')"/>

<fx:Object label="DataGroup"icon="@Embed('assets/DataGroup.png')"/>

<fx:Object label="HGroup"icon="@Embed('assets/HGroup.png')"/>

<fx:Object label="HScrollBar"icon="@Embed('assets/HScrollBar.png')"/>

<fx:Object label="HSlider"icon="@Embed('assets/HSlider.png')"/>

<fx:Object label="Label"icon="@Embed('assets/Label.png')"/>

<fx:Object label="List"icon="@Embed('assets/List.png')"/>

</mx:ArrayList>
</mx:dataProvider>
</mx:List>

</s:Application>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐