Displaying an italic font style on a TextBox control in Flex Gumbo

by Peter deHaan on December 12, 2008

in FXG, FontLookup, TextBox, beta

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″.

View MXML

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

Leave a Comment

Sorry, this blog is terrible at eating HTML comments.
If you're pasting any HTML/XML/MXML code, you need to convert your < characters to &lt; and your > characters to &gt; .

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Anti-Spam Protection by WP-SpamFree

Previous post:

Next post: