[b]flex 获取系统安装字体[/b]
截图:
[img]http://dl.iteye.com/upload/attachment/605797/fd4ffbca-b6d4-3f0a-a77c-e5de5fa6110f.png[/img]
附件为编译后的swf
截图:
[img]http://dl.iteye.com/upload/attachment/605797/fd4ffbca-b6d4-3f0a-a77c-e5de5fa6110f.png[/img]
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400"
height="300" creationComplete="findAllFonts()">
<mx:Script>
<![CDATA[
private var style:StyleSheet;
[Bindable]
private var arr:Array;
private function findAllFonts():void
{
arr = Font.enumerateFonts(true);
arr.sortOn("fontName", Array.CASEINSENSITIVE);
}
private function setFont():void
{
text.setStyle("fontFamily", (cb.selectedItem as
Font).fontName);
}
]]>
</mx:Script>
<mx:ComboBox id="cb" dataProvider="{arr}" change="setFont()"
labelField="fontName"/>
<mx:Text text="Sample Text" id="text" fontSize="16"/>
</mx:VBox>
附件为编译后的swf