Home Tutorial Flex Flex4 Components Embedded Font in Flex4


Share on Google+Share on Google+
Embedded Font in Flex4
Posted on: June 23, 2010 at 12:00 AM
You can embedded the font in your application. There are some file type of fonts:

Embedded font in Flex4:

You can embedded the font in your application. There are some file type of fonts:

1. True Type fonts (*.ttf)
2. Open Type fonts (*.otf)
3. True Type Collection (*.ttc)
4. Mac Data Fork Fonts (*.dfont)

Syntax of embedded font  is:

@font-face {
src: url("location");
fontFamily: alias;
[fontStyle: normal | italic | oblique] ;
[fontWeight: normal | bold | heavy] ;
[embedAsCFF:true | false] ;
[advancedAntiAliasing: true | false];

In this example you can see how we can embedded a font in your application.
In this example we use a MyriadWebPro.ttf  font.


<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"



minWidth="955" minHeight="600">

<!-- Using Embedded fonts -->


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

@font-face {


fontFamily: fontFamily1;

embedAsCFF: true;



font-family: fontFamily1;

font-size: 20;



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

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

<s:Button label="Submit"/>

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





Running Application:

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

Download this code


Related Tags for Embedded Font in Flex4:

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.

Posted on: June 23, 2010

Recommend the tutorial

Advertisements Advertisements