zoukankan      html  css  js  c++  java
  • 在移动设备应用程序中嵌入字体

    可以嵌入要在移动设备应用程序中使用的字体,但有一些限制条件。

    由于 Label 控件使用 FTE(因此使用 CFF 字体),在移动设备应用程序中嵌入字体时应使用具有基于 TextField 外观的 TextArea 或 TextInput 控件。不能嵌入具有基于 StageText 外观的字体。通常情况下,在移动设备应用程序中应避免使用 FTE。

    在您的 CSS 中,将 embedAsCFF 设置为 false,并应用基于 TextField 的外观,如下例所示:
    <?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;
                skinClass: ClassReference("spark.skins.mobile.TextAreaSkin");
            }   
        </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:layout>
            <s:VerticalLayout paddingTop="20" paddingLeft="20" paddingRight="20"/>
        </s:layout>
    
        <s:TextArea id="ta1" 
                    width="100%" 
                    styleName="customStyle"
                    text="This is a TextArea control that uses an embedded font."/>           
    
        <s:TextArea id="ta2" 
                    width="100%" 
                    text="This TextArea control does not use an embedded font."/>           
    
    </s:View>

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

    有关更多信息,请参阅嵌入字体

  • 相关阅读:
    ubuntu segmentation fault 段错误
    css配合js模拟的select下拉框
    让IE6下支持固定定位
    max-height,min-height在IE下不支持的解决方法
    图片居中
    完美运动框架,随意调用,兼容性好
    JS创建Ajax的XMLHttpRequest对象的通用方法
    JS兼容性问题(FF与IE)
    css样式
    html之marquee详解[转]
  • 原文地址:https://www.cnblogs.com/fuland/p/3629317.html
Copyright © 2011-2022 走看看