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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

USING FLEX 4<br />

Fonts<br />

Change the Button control’s typeface to be non-bold. The Spark Button (in the s namespace) control’s label renders<br />

with the embedded font because it does not require a bold faced font<br />

.For information on embedding bold typefaces, see “<strong>Using</strong> multiple typefaces” on page 15.<br />

You can also apply the embedded font inline by specifying the alias as the value of the control’s fontFamily property,<br />

as the following example shows:<br />

Resolved code-reference.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

@font-face {<br />

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

fontFamily: myFontFamily;<br />

advancedAntiAliasing: true;<br />

}<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

The text in the RichText control is Myriad Web Pro.<br />

<br />

<br />

<br />

<br />

<br />

Locating embedded fonts<br />

[Chunk: No] [Output: IPH, Print, Web] [EditorialStatus: Preliminary Review]<br />

The src property in the @font-face declaration specifies the location of the font family. You use the src property to<br />

embed a TrueType or OpenType font by location by specifying a valid URI to the font. The URI can be relative (for<br />

example, ../fontfolder/akbar.ttf) or absolute (for example, c:/myfonts/akbar.ttf). The URI can also point to a SWF file<br />

that has embedded fonts within it.<br />

You must specify the url of the src property in the @font-face declaration. All other properties are optional.<br />

Do not mix embedded and nonembedded fonts in the same fontFamily property.<br />

Embedding fonts in ActionScript<br />

[Chunk: No] [Output: IPH, Print, Web] [EditorialStatus: Preliminary Review]<br />

You can embed TrueType or OTF font files or system fonts by location or by name by using the [Embed] metadata tag<br />

in ActionScript. To embed a font by location, you use the source property in the [Embed] metadata tag. To embed a<br />

font by name, you use the systemFont property in the [Embed] metadata tag.<br />

7

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

Saved successfully!

Ooh no, something went wrong!