Using Font Awesome in Adobe flex 4

981 views Asked by At

How to use font awesome icons in adobe flex 4 and how to set styles in font awesome icons.
how to set button label text as icon in adobe flex.

1

There are 1 answers

0
Kavin On BEST ANSWER
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                       xmlns:s="library://ns.adobe.com/flex/spark"
                       xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";
    
    @font-face {
        fontFamily:             FontAwesome;
        embed-as-cff:           true;
        src:                    url("../assets/font-awesome-4.3.0/fonts/FontAwesome.otf");
        fontStyle:              normal;
    }
    @font-face {
        fontFamily:             FontAwesomeNonCff;
        embed-as-cff:           false;
        src:                    url("../assets/font-awesome-4.3.0/fonts/FontAwesome.otf");
        fontStyle:              normal;
    }
</fx:Style>

<s:VGroup paddingLeft="50" paddingRight="50" paddingTop="50" paddingBottom="50">
    <s:Label id="icon1" text="&#xf011;" color="#000000" fontFamily="FontAwesome" fontSize="40" />
    <s:Label id="icon2" text="&#xf11a;" color="#f700f3" fontFamily="FontAwesome" fontSize="40" />
    <s:Button label="&#xf00c; SUBMIT" fontFamily="FontAwesome" fontSize="20" />
    <s:Button label="&#xf00d; RESET" fontFamily="FontAwesome" fontSize="20" />
</s:VGroup>

</s:WindowedApplication>

Get all Font Awesome UNICODE : http://fontawesome.io/cheatsheet/

Paste font awesome folder in your project in any location