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

 

编译含有嵌入字体的手机应用程序时,默认情况下,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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值