您的位置:首页 > 产品设计 > UI/UE

Flex4 / flash builder 内嵌字体(适用于手机程序)

2011-11-16 13:37 239 查看
编译含有嵌入字体的手机应用程序时,默认情况下,Flex 将使用非 CFF 字体。CFF 字体使用 FTE。通常情况下,在手机应用程序中应避免使用 FTE。

由于
Label 控件使用 FTE(并因此使用 CFF 字体),因此在手机应用程序中嵌入字体时应使用
TextArea 或
TextInput 控件。

在 CSS 中,将 embedAsCFF 设置为
false,如下面的示例所示:
<?xml version="1.0" encoding="utf-8"?>
<!-- mobile_text/Main.mxml -->
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
firstView="views.EmbeddingFontsView">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@font-face {
src: url("../assets/MyriadWebPro.ttf");
fontFamily: myFontFamily;
embedAsCFF: false;
}
.customStyle {
fontFamily: myFontFamily;
fontSize: 24;
}
</fx:Style>
</s:ViewNavigatorApplication>


EmbeddingFontView 视图的 TextArea 控件应用类型选择器:
<?xml version="1.0" encoding="utf-8"?>
<!-- mobile_text/EmbeddingFontsView.mxml -->
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="Embedded Fonts">

<s:TextArea id="ta1"
width="100%"
styleName="customStyle"
text="This is a TextArea control that uses an embedded font."/>

</s:View>


如果使用类选择器(例如 s|TextArea)应用样式(或嵌入字体),请在主应用程序文件中定义类选择器。不能在手机应用程序的视图中定义类选择器。

有关更多信息,请参阅
Using embedded fonts。

http://help.adobe.com/zh_CN/flex/mobileapps/WS19f279b149e7481c6a9f451212b87fe7e87-8000.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: