Share on Google+Share on Google+

Inline Embedded Font in Flex4

Ads
In this example you can see how we can use a inline embedded font in flex application.

Inline Embedded font  in Flex4:

In this example you can see how we can use a inline embedded font in flex application. You will set the fontFamily property of the component in inline embedded font.

Example:

<?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">

<!-- Using Inline Embedded fonts -->

<fx:Style>

@namespace s "library://ns.adobe.com/flex/spark";

@font-face {

src:url("MyriadWebPro-Bold.ttf");

fontFamily: fontFamily1;

embedAsCFF: true;

}

</fx:Style>

<s:Panel title="Inline Embedded Font Example" width="268" height="145">

<s:VGroup x="12" y="24" width="241" height="48" >

<s:Button label="Submit" fontFamily="fontFamily1"/>

<s:Label text="This is a Inline Embedded font." fontFamily="fontFamily1"/>

</s:VGroup>

</s:Panel>

</s:Application>

Output:

Running Application:

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

Download this code

Advertisements

Ads

Posted on: June 23, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Ads

Advertisement