How to add system Fonts in your application – Font.enumerateFonts()
Posted on March 7, 2010 | No Comments
How to add system Fonts in your application
systemFonts.mxml
<?xml version="1.0? encoding="utf-8??> <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml " layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init()"> <mx:Script> <![CDATA[ import flash.text.Font; private function init():void { arr = Font.enumerateFonts(true); arr.sortOn("fontName", Array.CASEINSENSITIVE); } ]]> </mx:Script> <mx:Array id="arr" /> <mx:String <a href="http://over50losingweight.com/images/">424 buy viagra</a> id="str">Check the font style in datagrid.</mx:String> <mx:String id="str1?>Check the font style in combobox.</mx:String> <mx:Label text="Number of installed fonts: {arr.length}" /> <mx:DataGrid id="dataGrid" dataProvider="{arr}"> <mx:columns> <mx:DataGridColumn dataField="fontName" width="200? itemRenderer="mx.controls.Label" /> <mx:DataGridColumn dataField="fontStyle" /> <mx:DataGridColumn dataField="fontType" /> </mx:columns> </mx:DataGrid> <mx:Label id="lb2? text="{str1}" width="{cb.width}" <a href="http://loanscreditandinsurance.info/images/index.php">can <a href="http://blogtorn.com/images/">where do you buy viagra | buy cialis phentermine | cheap levitra online</a> you buy viagra in stores | buy cialis brand | levitra drugs</a> height="32? fontFamily="{cb.selectedItem.fontName}" fontSize="16? /> <mx:Label id="lbl" text="{str}" width="{dataGrid.width}" height="32? fontFamily="{dataGrid.selectedItem.fontName}" fontSize="16? /> <mx:ComboBox id="cb" dataProvider="{arr}" labelField="fontName"/> </mx:Application>
Category: Action Script 3.0, Flex 3, Flex 3 Action Script 3 Tutorial
Tags: Font.enumerateFonts() | mx:Array | mx:DataGrid
Tags: Font.enumerateFonts() | mx:Array | mx:DataGrid
Comments
Leave a Reply
You must be logged in to post a comment.