The following example shows how you can specify an italic font style on a device and embedded font on a Flex Gumbo TextBox control by setting the fontStyle style.
Full code after the jump.
To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see “Using the beta Gumbo SDK in Flex Builder 3″.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/12/12/displaying-an-italic-font-style-on-a-textbox-control-in-flex-gumbo/ -->
<Application name="TextBox_fontStyle_test"
xmlns="http://ns.adobe.com/mxml/2009"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<Style>
@font-face {
src: url("C:/Windows/Fonts/ARIALI.TTF");
fontFamily: "ArialEmbedded";
fontStyle: "italic";
cff: true;
}
</Style>
<VGroup>
<TextBox id="deviceTextBox"
text="The quick brown fox jumps over the lazy dog. (device)"
fontFamily="Arial"
fontStyle="italic"
fontLookup="device" />
<TextBox id="embeddedCFFTextBox"
text="The quick brown fox jumps over the lazy dog. (embeddedCFF)"
fontFamily="ArialEmbedded"
fontLookup="embeddedCFF"
fontStyle="italic" />
</VGroup>
</Application>
