<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/09/10/finding-out-which-fonts-are-installed-on-a-users-system/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
		layout="vertical"
		verticalAlign="middle"
		backgroundColor="white"
		creationComplete="init()" viewSourceURL="srcview/index.html">

	<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 id="str">The quick brown fox jumped over the lazy dog.</mx:String>
	
	<mx:ApplicationControlBar dock="true">
		<mx:Label text="String:" />
		<mx:TextInput id="textInput" text="{str}" />

		<mx:Spacer width="100%" />

		<mx:Label text="Number of installed fonts: {arr.length}" />
	</mx:ApplicationControlBar>

	<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="lbl"
			text="{textInput.text}"
			width="{dataGrid.width}"
			height="32"
			fontFamily="{dataGrid.selectedItem.fontName}"
			fontSize="16" />

</mx:Application>

