30.11.2012 Views

Using Adobe® Flex® 4 - Adobe Blogs

Using Adobe® Flex® 4 - Adobe Blogs

Using Adobe® Flex® 4 - Adobe Blogs

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

tf1.font = "myPlainFont";<br />

var tf2:TextFormat = new TextFormat();<br />

tf2.font = "Arial";<br />

b1 = FlexGlobals.topLevelApplication.systemManager.<br />

isFontFaceEmbedded(tf1);<br />

b2 = FlexGlobals.topLevelApplication.systemManager.<br />

isFontFaceEmbedded(tf2);<br />

}<br />

]]><br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

In this example, the font identified by the myPlainFont family name is embedded, but the Arial font is not.<br />

USING FLEX 4<br />

Fonts<br />

You can use the Font class’s enumerateFonts() method to output information about device or embedded fonts. The<br />

following example lists embedded fonts:<br />

Resolved code-reference.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

@font-face {<br />

src:url("../assets/MyriadWebPro.ttf");<br />

fontFamily: myFont;<br />

advancedAntiAliasing: true;<br />

embedAsCFF: true;<br />

}<br />

@font-face {<br />

src:url("../assets/MyriadWebPro-Bold.ttf");<br />

fontFamily: myFont;<br />

fontWeight: bold;<br />

advancedAntiAliasing: true;<br />

embedAsCFF: true;<br />

}<br />

@font-face {<br />

src:url("../assets/MyriadWebPro-Italic.ttf");<br />

fontFamily: myFont;<br />

fontStyle: italic;<br />

advancedAntiAliasing: true;<br />

13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!