随笔 - 25, 文章 - 1, 评论 - 0, 引用 - 0
数据加载中……

[20100514]-[FLEX4]-[在SWF中嵌入字体]

起因是 Flex4中使用的仍然是MX的DataGrid 但是因为字体原因 ,使得DataGrid在某些效果上(如Fade|Rotate)可能无效甚至失去响应,解决的办法是把字体嵌入到SWF中去.参考代码:
<fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/mx";
        @namespace bi "com.neusoft.bi.*";
        @namespace widgets "com.neusoft.biframework.widgets.*";
        @font-face {
            src:url("assets/fonts/jsong.ttf"); 
            fontFamily: "jsong";
            embedAsCFF: false;
        }
    
</fx:Style>


<mx:DataGrid x="0"
                     y
="0"
                     id
="grid1"
                     dataProvider
="{data}"
                     width
="100%"
                     height
="100%">
            
<mx:columns>
                
<mx:DataGridColumn headerText="列1"
                                   fontFamily
="jsong"
                                   dataField
="col1"/>
                
<mx:DataGridColumn headerText="列2"
                                   fontFamily
="jsong"
                                   dataField
="col2"/>
                
<mx:DataGridColumn headerText="列3"
                                   fontFamily
="jsong"
                                   dataField
="col3"/>
            
</mx:columns>
        
</mx:DataGrid>

posted on 2010-05-14 16:33 至尊贝贝 阅读(718) 评论(0)  编辑  收藏 所属分类: FLEX--MXML


只有注册用户登录后才能发表评论。


网站导航: