In this example you can see how we can use a embedded font using actionscript.
|
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"xmlns:s=" library://ns.adobe.com/flex/spark"xmlns:mx=" library://ns.adobe.com/flex/mx"minWidth=" 955" minHeight="600"> <!-- Embedded font using Action Script --> <fx:Style> .style1 { fontFamily:myriadFont; fontSize: 20pt;} .style2 { fontFamily:boldFont; fontSize: 18pt; fontWeight: bold;} </fx:Style> <fx:Script>[ Embed(source='MyriadWebPro.ttf',fontName= 'myriadFont',mimeType= 'application/x-font',embedAsCFF= 'true')] private var font1:Class;[ Embed(source='MyriadWebPro-Bold.ttf',fontName= 'boldFont',mimeType= 'application/x-font',embedAsCFF= 'true')] private var font2:Class; </fx:Script> <s:Panel title="Embedded Font Using Action Script Example"width=" 348" height="145"> <s:VGroup x="12" y="24" width="324" height="48"> <s:Button label="Submit" styleName="style1"/> <s:Label text="This is a Embedded font using ActionScript."styleName=" style2"/> </s:VGroup> </s:Panel></s:Application> |

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.