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)应用样式(或嵌入字体),请在主应用程序文件中定义类选择器。不能在移动设备应用程序的视图中定义类选择器。

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

  • 相关阅读:
    nginx配置zabbix下setup.php(web页面)无法显示,浏览器无法打开
    CentOS release 6.5下jdk1.7升级到1.8
    tcp流量控制
    图像处理服务器
    muduo rpc protobuf 实现学习
    p2p nat 穿透原理
    博客-livevent-stl-cpp-nginx
    使用eventfd创建一个用于事件通知的文件描述符
    多线程设计的类的思考!
    ftp协议服务器与tinyhttp服务demo
  • 原文地址:https://www.cnblogs.com/fuland/p/3629317.html
Copyright © 2011-2022 走看看