Flex 4中如何给Halo Label设置嵌入字体的例子
By Minidxer | October 11, 2009
接下来的例子演示了Flex 4中如何通过textFieldClass样式,给Halo Label设置嵌入字体。
下面是main.mxml:
- <?xml version="1.0" encoding="utf-8"?>
- <s:Application name="Label_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">
- <fx:Style>
- @namespace mx "library://ns.adobe.com/flex/halo";
- @namespace s "library://ns.adobe.com/flex/spark";
- @font-face {
- src: url("fonts/ArnoPro-Regular.otf");
- fontFamily: ArnoEmbedded;
- embedAsCFF: true;
- }
- mx|Label, s|SimpleText {
- fontFamily: ArnoEmbedded;
- fontSize: 24;
- }
- </fx:Style>
- <fx:Declarations>
- <fx:String id="txt">The quick brown fox jumps over the lazy dog.</fx:String>
- </fx:Declarations>
- <s:VGroup horizontalCenter="0" verticalCenter="0">
- <mx:Label id="lbl"
- text="{txt} [Label]"
- textFieldClass="mx.core.UITLFTextField"
- width="100%" />
- <s:SimpleText id="simpleTxt"
- text="{txt} [SimpleText]"
- width="100%" />
- </s:VGroup>
- </s:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Gumbo, Label |
No Comments » |
Tags: Gumbo, textFieldClass