加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-15 01:04:18 所属栏目:百科 来源:网络整理
导读:? 编译含有嵌入字体的手机应用程序时,默认情况下,Flex 将使用非 CFF 字体。CFF 字体使用 FTE。通常情况下,在手机应用程序中应避免使用 FTE。 由于 Label 控件使用 FTE(并因此使用 CFF 字体),因此在手机应用程序中嵌入字体时应使用 TextArea 或 TextInp
?

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读