在datagrid中应用自定义的字体

<?xml version="1.0" encoding="utf-8"?>
<s:Application name="MX_AdvancedDataGrid_fontFamily_test"
			   xmlns:fx="http://ns.adobe.com/mxml/2009"
			   xmlns:s="library://ns.adobe.com/flex/spark"
			   xmlns:mx="library://ns.adobe.com/flex/mx">
	
	<fx:Style>
		@namespace s "library://ns.adobe.com/flex/spark";
		@namespace mx "library://ns.adobe.com/flex/mx";
		
		@font-face {
			src: url("C:/Windows/Fonts/comic.ttf");
			fontFamily: myEmbeddedFont;
			fontWeight: normal;
			embedAsCFF: false;
		}
		
		mx|AdvancedDataGrid {
			fontFamily: myEmbeddedFont;
		}
	</fx:Style>
	
	<mx:AdvancedDataGrid id="adg"
						 horizontalCenter="0" verticalCenter="0">
		<mx:columns>
			<mx:AdvancedDataGridColumn dataField="@label" />
			<mx:AdvancedDataGridColumn dataField="@data" />
		</mx:columns>
		<mx:dataProvider>
			<s:XMLListCollection id="dp">
				<s:source>
					<fx:XMLList>
						<product label="Product 1" data="3" />
						<product label="Product 2" data="1" />
						<product label="Product 3" data="4" />
						<product label="Product 4" data="1" />
						<product label="Product 5" data="5" />
						<product label="Product 6" data="9" />
					</fx:XMLList>
				</s:source>
			</s:XMLListCollection>
		</mx:dataProvider>
	</mx:AdvancedDataGrid>
	
</s:Application>
 

你可能感兴趣的:(c,windows,xml,Flex,Adobe)