<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; fontFamily</title>
	<atom:link href="http://blog.flexexamples.com/tag/fontfamily/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using embedded fonts with the MX AdvancedDataGrid control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 09:10:21 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[AdvancedDataGrid]]></category>
		<category><![CDATA[beta2]]></category>
		<category><![CDATA[embedAsCFF]]></category>
		<category><![CDATA[fontFamily]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2519</guid>
		<description><![CDATA[<p>The following example shows how you can use an embedded font with the MX AdvancedDataGrid control in Flex 4 by setting the embedAsCFF and fontFamily styles.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;MX_AdvancedDataGrid_fontFamily_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/mx&#34;&#62; &#160; &#60;fx:Style&#62; @namespace s &#34;library://ns.adobe.com/flex/spark&#34;; @namespace mx &#34;library://ns.adobe.com/flex/mx&#34;; &#160; @font-face { src: url(&#34;C:/Windows/Fonts/comic.ttf&#34;); fontFamily: myEmbeddedFont; fontWeight: normal; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use an embedded font with the MX AdvancedDataGrid control in Flex 4 by setting the <code>embedAsCFF</code> and <code>fontFamily</code> styles.</p>
<p><span id="more-2519"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_AdvancedDataGrid_fontFamily_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
&nbsp;
        @font-face {
            src: url(&quot;C:/Windows/Fonts/comic.ttf&quot;);
            fontFamily: myEmbeddedFont;
            fontWeight: normal;
            embedAsCFF: false;
        }
&nbsp;
        mx|AdvancedDataGrid {
            fontFamily: myEmbeddedFont;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:AdvancedDataGrid</span> id=<span style="color: #ff0000;">&quot;adg&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:AdvancedDataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;@label&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:AdvancedDataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;@data&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;dp&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:source</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 1&quot;</span> data=<span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 2&quot;</span> data=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 3&quot;</span> data=<span style="color: #ff0000;">&quot;4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 4&quot;</span> data=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 5&quot;</span> data=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 6&quot;</span> data=<span style="color: #ff0000;">&quot;9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:source</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:AdvancedDataGrid</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_AdvancedDataGrid_fontFamily_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_AdvancedDataGrid_fontFamily_test/main.html" width="100%" height="300"></iframe></p>
<p>If you want to use a CFF/DefineFont4 font, you can set the <code>embedAsCFF</code> style to <em>true</em> and enable Flash Text Engine in MX components by selecting Project &gt; Properties from the main menu and then selecting the &#8220;Use Flash Text Engine in MX components&#8221; option in the Flex Compiler category.</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_AdvancedDataGrid_fontFamily_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
&nbsp;
        @font-face {
            src: url(&quot;C:/Windows/Fonts/comic.ttf&quot;);
            fontFamily: myEmbeddedFont;
            fontWeight: normal;
            embedAsCFF: true;
        }
&nbsp;
        mx|AdvancedDataGrid {
            fontFamily: myEmbeddedFont;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:AdvancedDataGrid</span> id=<span style="color: #ff0000;">&quot;adg&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:AdvancedDataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;@label&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:AdvancedDataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;@data&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;dp&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:source</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 1&quot;</span> data=<span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 2&quot;</span> data=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 3&quot;</span> data=<span style="color: #ff0000;">&quot;4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 4&quot;</span> data=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 5&quot;</span> data=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 6&quot;</span> data=<span style="color: #ff0000;">&quot;9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:source</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:AdvancedDataGrid</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using embedded fonts with the MX AdvancedDataGrid control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/',contentID: 'post-2519',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'embedAsCFF,fontFamily,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using an embedded font with the LinkButton control in Flex</title>
		<link>http://blog.flexexamples.com/2008/09/04/using-an-embedded-font-with-the-linkbutton-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/09/04/using-an-embedded-font-with-the-linkbutton-control-in-flex/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 06:54:27 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[LinkButton]]></category>
		<category><![CDATA[fontFamily]]></category>
		<category><![CDATA[fontWeight]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/04/using-an-embedded-font-with-the-linkbutton-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use an embedded font with the Flex LinkButton control by setting the fontFamily and fontWeight styles.</p> <p class="note">The LinkButton control uses a bold font weight by default, so you need to either embed the bold font weight, or set the LinkButton control&#8217;s fontWeight style to normal.</p> <p>Full code [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use an embedded font with the Flex LinkButton control by setting the <code>fontFamily</code> and <code>fontWeight</code> styles.</p>
<p class="note">The LinkButton control uses a bold font weight by default, so you need to either embed the bold font weight, or set the LinkButton control&#8217;s <code>fontWeight</code> style to normal.</p>
<p>Full code after the jump.</p>
<p><span id="more-785"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkButton_fontFamily_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/04/using-an-embedded-font-with-the-linkbutton-control-in-flex/ --&gt;
&lt;mx:Application name="LinkButton_fontFamily_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Arial");
            fontFamily: ArialEmbedded;
            fontWeight: bold;
        }

        LinkButton {
            fontFamily: ArialEmbedded;
        }
    &lt;/mx:Style&gt;

    &lt;mx:LinkButton id="linkButton"
            label="LinkButton"
            rotation="45" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkButton_fontFamily_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/LinkButton_fontFamily_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>You can also embed the font using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LinkButton_fontFamily_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/04/using-an-embedded-font-with-the-linkbutton-control-in-flex/ --&gt;
&lt;mx:Application name="LinkButton_fontFamily_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.LinkButton;

            [Embed(systemFont="Arial",
                    fontName="ArialEmbedded",
                    fontWeight="bold",
                    mimeType="application/x-font")]
            private const arialEmbedded:Class;

            private var linkButton:LinkButton;

            private function init():void {
                linkButton = new LinkButton();
                linkButton.label = "LinkButton";
                linkButton.rotation = 45;
                linkButton.setStyle("fontFamily", "ArialEmbedded");
                addChild(linkButton);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using an embedded font with the LinkButton control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/09/04/using-an-embedded-font-with-the-linkbutton-control-in-flex/',contentID: 'post-785',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fontFamily,fontWeight',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/09/04/using-an-embedded-font-with-the-linkbutton-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Displaying different fonts in a dropdown menu on a ComboBox control in Flex</title>
		<link>http://blog.flexexamples.com/2008/07/31/displaying-different-fonts-in-a-dropdown-menu-on-a-combobox-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/07/31/displaying-different-fonts-in-a-dropdown-menu-on-a-combobox-control-in-flex/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 14:56:04 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ComboBox]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[dropdown]]></category>
		<category><![CDATA[fontFamily]]></category>
		<category><![CDATA[itemRenderer]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/07/31/displaying-different-fonts-in-a-dropdown-menu-on-a-combobox-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set different fonts for different items in a Flex ComboBox control&#8217;s dropdown menu by using a custom item renderer.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ComboBox_itemRenderer_fontFamily_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/07/31/displaying-different-fonts-in-a-dropdown-menu-on-a-combobox-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" backgroundColor="white"&#62; &#60;mx:ArrayCollection id="arrColl" source="{Font.enumerateFonts(true)}"&#62; &#60;mx:sort&#62; &#60;mx:Sort&#62; &#60;mx:fields&#62; &#60;mx:SortField name="fontName" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set different fonts for different items in a Flex ComboBox control&#8217;s dropdown menu by using a custom item renderer.</p>
<p>Full code after the jump.</p>
<p><span id="more-723"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ComboBox_itemRenderer_fontFamily_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/07/31/displaying-different-fonts-in-a-dropdown-menu-on-a-combobox-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&gt;

    &lt;mx:ArrayCollection id="arrColl"
            source="{Font.enumerateFonts(true)}"&gt;
        &lt;mx:sort&gt;
            &lt;mx:Sort&gt;
                &lt;mx:fields&gt;
                    &lt;mx:SortField name="fontName" /&gt;
                &lt;/mx:fields&gt;
            &lt;/mx:Sort&gt;
        &lt;/mx:sort&gt;
    &lt;/mx:ArrayCollection&gt;

    &lt;mx:ComboBox id="comboBox"
            dataProvider="{arrColl}"
            labelField="fontName"
            fontSize="14"
            open="comboBox.dropdown.variableRowHeight = true;"&gt;
        &lt;mx:itemRenderer&gt;
            &lt;mx:Component&gt;
                &lt;mx:Label fontFamily="{data.fontName}"
                        toolTip="{data.fontName}" /&gt;
            &lt;/mx:Component&gt;
        &lt;/mx:itemRenderer&gt;
    &lt;/mx:ComboBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ComboBox_itemRenderer_fontFamily_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/ComboBox_itemRenderer_fontFamily_test/bin/main.html" width="100%" height="250"></iframe></p>
<p class="alert">For an example of doing this in the Flex 4 SDK, see <a href="http://blog.flexexamples.com/2009/07/17/displaying-different-fonts-in-a-spark-list-control-in-flex-4/">&#8220;Displaying different fonts in a Spark List control in Flex 4&#8243;</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying different fonts in a dropdown menu on a ComboBox control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/07/31/displaying-different-fonts-in-a-dropdown-menu-on-a-combobox-control-in-flex/',contentID: 'post-723',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dropdown,fontFamily,itemRenderer',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/07/31/displaying-different-fonts-in-a-dropdown-menu-on-a-combobox-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Using embedded fonts with the ComboBox control in Flex</title>
		<link>http://blog.flexexamples.com/2008/07/06/using-embedded-fonts-with-the-combobox-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/07/06/using-embedded-fonts-with-the-combobox-control-in-flex/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 05:58:50 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ComboBox]]></category>
		<category><![CDATA[dropdownStyleName]]></category>
		<category><![CDATA[fontFamily]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/07/06/using-embedded-fonts-with-the-combobox-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use an embedded font with the Flex ComboBox control by setting the fontFamily style and dropdownStyleName style.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/07/06/using-embedded-fonts-with-the-combobox-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" backgroundColor="white"&#62; &#60;mx:Style&#62; @font-face { src: local("Comic Sans MS"); fontFamily: EmbeddedComicSansMS; fontWeight: normal; } @font-face { [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use an embedded font with the Flex ComboBox control by setting the <code>fontFamily</code> style and <code>dropdownStyleName</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-698"></span></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/07/06/using-embedded-fonts-with-the-combobox-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Comic Sans MS");
            fontFamily: EmbeddedComicSansMS;
            fontWeight: normal;
        }

        @font-face {
            src: local("Comic Sans MS");
            fontFamily: EmbeddedComicSansMS;
            fontWeight: bold;
        }

        ComboBox {
            fontFamily: EmbeddedComicSansMS;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="One" /&gt;
        &lt;mx:Object label="Two" /&gt;
        &lt;mx:Object label="Three" /&gt;
        &lt;mx:Object label="Four" /&gt;
        &lt;mx:Object label="Five" /&gt;
        &lt;mx:Object label="Six" /&gt;
        &lt;mx:Object label="Seven" /&gt;
        &lt;mx:Object label="Eight" /&gt;
        &lt;mx:Object label="Nine" /&gt;
        &lt;mx:Object label="Ten" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ComboBox id="comboBox"
            dataProvider="{arr}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>If you want to set the font separately on the ComboBox control&#8217;s dropdown menu, you can set the ComboBox control&#8217;s <code>dropdownStyleName</code> style, as seen in the following example:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/07/06/using-embedded-fonts-with-the-combobox-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Comic Sans MS");
            fontFamily: EmbeddedComicSansMS;
            fontWeight: normal;
        }

        @font-face {
            src: local("Comic Sans MS");
            fontFamily: EmbeddedComicSansMS;
            fontWeight: bold;
        }

        ComboBox {
            dropdownStyleName: comboBoxDropdownStyles;
        }

        .comboBoxDropdownStyles {
            fontFamily: EmbeddedComicSansMS;
            fontWeight: normal;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="One" /&gt;
        &lt;mx:Object label="Two" /&gt;
        &lt;mx:Object label="Three" /&gt;
        &lt;mx:Object label="Four" /&gt;
        &lt;mx:Object label="Five" /&gt;
        &lt;mx:Object label="Six" /&gt;
        &lt;mx:Object label="Seven" /&gt;
        &lt;mx:Object label="Eight" /&gt;
        &lt;mx:Object label="Nine" /&gt;
        &lt;mx:Object label="Ten" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ComboBox id="comboBox"
            dataProvider="{arr}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="new">For an example of using different fonts in a ComboBox control&#8217;s dropdown menu, see <a href="http://blog.flexexamples.com/2008/07/31/displaying-different-fonts-in-a-dropdown-menu-on-a-combobox-control-in-flex/">&#8220;Displaying different fonts in a dropdown menu on a ComboBox control in Flex&#8221;</a>.</p>
<p class="new">For another example of using embedded fonts with the ComboBox control, see <a href="http://blog.flexexamples.com/2008/06/02/using-an-embedded-font-with-the-combobox-control-in-flex/">&#8220;Using an embedded font with the ComboBox control in Flex&#8221;</a>. Sigh.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using embedded fonts with the ComboBox control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/07/06/using-embedded-fonts-with-the-combobox-control-in-flex/',contentID: 'post-698',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dropdownStyleName,fontFamily',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/07/06/using-embedded-fonts-with-the-combobox-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using an embedded font with the ColorPicker control in Flex</title>
		<link>http://blog.flexexamples.com/2008/06/15/using-an-embedded-font-with-the-colorpicker-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/06/15/using-an-embedded-font-with-the-colorpicker-control-in-flex/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 05:55:25 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[fontFamily]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/15/using-an-embedded-font-with-the-colorpicker-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use an embedded font with the Flex ColorPicker control by setting the fontFamily style.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2008/06/15/using-an-embedded-font-with-the-colorpicker-control-in-flex/ --&#62; &#60;mx:Application name=&#34;ColorPicker_fontFamily_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#160; &#60;mx:Style&#62; @font-face { src: local(&#34;Base 02&#34;); fontFamily: Base02Embedded; } &#60;/mx:Style&#62; &#160; &#60;mx:Script&#62; &#60;![CDATA[ private function uintToHex(value:uint):String { var prefix:String = [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use an embedded font with the Flex ColorPicker control by setting the <code>fontFamily</code> style.</p>
<p><span id="more-670"></span></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2008/06/15/using-an-embedded-font-with-the-colorpicker-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;ColorPicker_fontFamily_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @font-face {
            src: local(&quot;Base 02&quot;);
            fontFamily: Base02Embedded;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            private function uintToHex(value:uint):String {</span>
<span style="color: #339933;">                var prefix:String = &quot;000000&quot;;</span>
<span style="color: #339933;">                var str:String = String(prefix + value.toString(16));</span>
<span style="color: #339933;">                return &quot;#&quot; + str.substr(-6).toUpperCase();</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;colorPicker&quot;</span></span>
<span style="color: #000000;">                fontFamily=<span style="color: #ff0000;">&quot;Base02Embedded&quot;</span></span>
<span style="color: #000000;">                editable=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> id=<span style="color: #ff0000;">&quot;lbl&quot;</span></span>
<span style="color: #000000;">                text=<span style="color: #ff0000;">&quot;{uintToHex(colorPicker.selectedColor)}&quot;</span></span>
<span style="color: #000000;">                fontFamily=<span style="color: #ff0000;">&quot;_typewriter&quot;</span></span>
<span style="color: #000000;">                fontSize=<span style="color: #ff0000;">&quot;16&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_fontFamily_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_fontFamily_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>You can also set the <code>fontFamily</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2008/06/15/using-an-embedded-font-with-the-colorpicker-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @font-face {
            src: local(&quot;Base 02&quot;);
            fontFamily: Base02Embedded;
        }
&nbsp;
        ColorPicker {
            fontFamily: Base02Embedded;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            private function uintToHex(value:uint):String {</span>
<span style="color: #339933;">                var prefix:String = &quot;000000&quot;;</span>
<span style="color: #339933;">                var str:String = String(prefix + value.toString(16));</span>
<span style="color: #339933;">                return &quot;#&quot; + str.substr(-6).toUpperCase();</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;colorPicker&quot;</span></span>
<span style="color: #000000;">                editable=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> id=<span style="color: #ff0000;">&quot;lbl&quot;</span></span>
<span style="color: #000000;">                text=<span style="color: #ff0000;">&quot;{uintToHex(colorPicker.selectedColor)}&quot;</span></span>
<span style="color: #000000;">                fontFamily=<span style="color: #ff0000;">&quot;_typewriter&quot;</span></span>
<span style="color: #000000;">                fontSize=<span style="color: #ff0000;">&quot;16&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Or, you can set the <code>fontFamily</code> style using ActionScript, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2008/06/15/using-an-embedded-font-with-the-colorpicker-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span></span>
<span style="color: #000000;">        creationComplete=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @font-face {
            src: local(&quot;Base 02&quot;);
            fontFamily: Base02Embedded;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                colorPicker.setStyle(&quot;fontFamily&quot;, &quot;Base02Embedded&quot;);</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function uintToHex(value:uint):String {</span>
<span style="color: #339933;">                var prefix:String = &quot;000000&quot;;</span>
<span style="color: #339933;">                var str:String = String(prefix + value.toString(16));</span>
<span style="color: #339933;">                return &quot;#&quot; + str.substr(-6).toUpperCase();</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;colorPicker&quot;</span></span>
<span style="color: #000000;">                editable=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">                initialize=<span style="color: #ff0000;">&quot;init();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> id=<span style="color: #ff0000;">&quot;lbl&quot;</span></span>
<span style="color: #000000;">                text=<span style="color: #ff0000;">&quot;{uintToHex(colorPicker.selectedColor)}&quot;</span></span>
<span style="color: #000000;">                fontFamily=<span style="color: #ff0000;">&quot;_typewriter&quot;</span></span>
<span style="color: #000000;">                fontSize=<span style="color: #ff0000;">&quot;16&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">Base 02 font by <a href="http://www.stereo-type.net/">www.stereo-type.net</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using an embedded font with the ColorPicker control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/06/15/using-an-embedded-font-with-the-colorpicker-control-in-flex/',contentID: 'post-670',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fontFamily',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/06/15/using-an-embedded-font-with-the-colorpicker-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using an embedded font with the TabBar control in Flex</title>
		<link>http://blog.flexexamples.com/2008/06/07/using-an-embedded-font-with-the-tabbar-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/06/07/using-an-embedded-font-with-the-tabbar-control-in-flex/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 06:47:27 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TabBar]]></category>
		<category><![CDATA[fontFamily]]></category>
		<category><![CDATA[fontWeight]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/07/using-an-embedded-font-with-the-tabbar-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use an embedded font with the Flex TabBar control by setting the fontFamily and fontWeight styles.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/06/07/using-an-embedded-font-with-the-tabbar-control-in-flex/ --&#62; &#60;mx:Application name="TabBar_fontFamily_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; @font-face { src: local("Base 02"); fontFamily: EmbeddedBase02; fontWeight: bold; } &#60;/mx:Style&#62; &#60;mx:VBox id="vBox" verticalGap="0" width="320" height="200"&#62; &#60;mx:TabBar id="tabBar" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use an embedded font with the Flex TabBar control by setting the <code>fontFamily</code> and <code>fontWeight</code> styles.</p>
<p><span id="more-661"></span></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/06/07/using-an-embedded-font-with-the-tabbar-control-in-flex/ --&gt;
&lt;mx:Application name="TabBar_fontFamily_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Base 02");
            fontFamily: EmbeddedBase02;
            fontWeight: bold;
        }
    &lt;/mx:Style&gt;

    &lt;mx:VBox id="vBox"
            verticalGap="0"
            width="320"
            height="200"&gt;
        &lt;mx:TabBar id="tabBar"
                dataProvider="{viewStack}"
                fontFamily="EmbeddedBase02"
                width="100%" /&gt;
        &lt;mx:ViewStack id="viewStack"
                width="100%"
                height="100%"
                backgroundColor="white"&gt;
            &lt;mx:VBox label="One"&gt;
                &lt;mx:Label text="one..." /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label="Two"&gt;
                &lt;mx:Label text="two..." /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label="Three"&gt;
                &lt;mx:Label text="three..." /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label="Four"&gt;
                &lt;mx:Label text="four..." /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label="Five"&gt;
                &lt;mx:Label text="five..." /&gt;
            &lt;/mx:VBox&gt;
        &lt;/mx:ViewStack&gt;
    &lt;/mx:VBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TabBar_fontFamily_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/TabBar_fontFamily_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>You can also set the <code>fontFamily</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TabBar_fontFamily_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/06/07/using-an-embedded-font-with-the-tabbar-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local(&quot;Base 02&quot;);
            fontFamily: EmbeddedBase02;
            fontWeight: bold;
        }

        <strong style="color:red;">TabBar {
            fontFamily: EmbeddedBase02;
        }</strong>
    &lt;/mx:Style&gt;

    &lt;mx:VBox id=&quot;vBox&quot;
            verticalGap=&quot;0&quot;
            width=&quot;320&quot;
            height=&quot;200&quot;&gt;
        &lt;mx:TabBar id=&quot;tabBar&quot;
                dataProvider=&quot;{viewStack}&quot;
                width=&quot;100%&quot; /&gt;
        &lt;mx:ViewStack id=&quot;viewStack&quot;
                width=&quot;100%&quot;
                height=&quot;100%&quot;
                backgroundColor=&quot;white&quot;&gt;
            &lt;mx:VBox label=&quot;One&quot;&gt;
                &lt;mx:Label text=&quot;one...&quot; /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label=&quot;Two&quot;&gt;
                &lt;mx:Label text=&quot;two...&quot; /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label=&quot;Three&quot;&gt;
                &lt;mx:Label text=&quot;three...&quot; /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label=&quot;Four&quot;&gt;
                &lt;mx:Label text=&quot;four...&quot; /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label=&quot;Five&quot;&gt;
                &lt;mx:Label text=&quot;five...&quot; /&gt;
            &lt;/mx:VBox&gt;
        &lt;/mx:ViewStack&gt;
    &lt;/mx:VBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>fontFamily</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TabBar_fontFamily_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/06/07/using-an-embedded-font-with-the-tabbar-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local(&quot;Base 02&quot;);
            fontFamily: EmbeddedBase02;
            fontWeight: bold;
        }
    &lt;/mx:Style&gt;

    <strong style="color:red;">&lt;mx:Script&gt;
        &lt;![CDATA[
            private function init():void {
                tabBar.setStyle(&quot;fontFamily&quot;, &quot;EmbeddedBase02&quot;);
            }
        ]]&gt;
    &lt;/mx:Script&gt;</strong>

    &lt;mx:VBox id=&quot;vBox&quot;
            verticalGap=&quot;0&quot;
            width=&quot;320&quot;
            height=&quot;200&quot;&gt;
        &lt;mx:TabBar id=&quot;tabBar&quot;
                dataProvider=&quot;{viewStack}&quot;
                width=&quot;100%&quot;
                <strong style="color:red;">initialize=&quot;init();&quot;</strong> /&gt;
        &lt;mx:ViewStack id=&quot;viewStack&quot;
                width=&quot;100%&quot;
                height=&quot;100%&quot;
                backgroundColor=&quot;white&quot;&gt;
            &lt;mx:VBox label=&quot;One&quot;&gt;
                &lt;mx:Label text=&quot;one...&quot; /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label=&quot;Two&quot;&gt;
                &lt;mx:Label text=&quot;two...&quot; /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label=&quot;Three&quot;&gt;
                &lt;mx:Label text=&quot;three...&quot; /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label=&quot;Four&quot;&gt;
                &lt;mx:Label text=&quot;four...&quot; /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox label=&quot;Five&quot;&gt;
                &lt;mx:Label text=&quot;five...&quot; /&gt;
            &lt;/mx:VBox&gt;
        &lt;/mx:ViewStack&gt;
    &lt;/mx:VBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TabBar_fontFamily_test/bin/srcview/source/main4.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/06/07/using-an-embedded-font-with-the-tabbar-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:comps="comps.*"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;comps:MyComp /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TabBar_fontFamily_test/bin/srcview/source/comps/MyComp.as.html">comps/MyComp.as</a></p>
<pre class="code">
package comps {
    import mx.containers.VBox;
    import mx.containers.ViewStack;
    import mx.controls.Label;
    import mx.controls.TabBar;
    import mx.core.Container;

    public class MyComp extends VBox {
        [Embed(systemFont="Base 02",
                fontName="EmbeddedBase02",
                fontWeight="bold",
                advancedAntiAliasing="true",
                mimeType="application/x-font")]
        private var EmbeddedBase02:Class;

        public var tabBar:TabBar;
        public var viewStack:ViewStack;
        public var child1:Container;
        public var child2:Container;
        public var child3:Container;
        public var child4:Container;
        public var child5:Container;

        public function MyComp() {
            super();
            init();
        }

        private function init():void {
            setStyle("verticalGap", 0);
            width = 320;
            height = 240;

            var label1:Label;
            var label2:Label;
            var label3:Label;
            var label4:Label;
            var label5:Label;

            label1 = new Label();
            label1.text =  "one...";

            label2 = new Label();
            label2.text =  "two...";

            label3 = new Label();
            label3.text =  "three...";

            label4 = new Label();
            label4.text =  "four...";

            label5 = new Label();
            label5.text =  "five...";

            child1 = new VBox();
            child1.label = "One";
            child1.addChild(label1);

            child2 = new VBox();
            child2.label = "Two";
            child2.addChild(label2);

            child3 = new VBox();
            child3.label = "Three";
            child3.addChild(label3);

            child4 = new VBox();
            child4.label = "Four";
            child4.addChild(label4);

            child5 = new VBox();
            child5.label = "Five";
            child5.addChild(label5);

            viewStack = new ViewStack();
            viewStack.percentWidth = 100;
            viewStack.percentHeight = 100;
            viewStack.setStyle("backgroundColor", "white");
            viewStack.addChild(child1);
            viewStack.addChild(child2);
            viewStack.addChild(child3);
            viewStack.addChild(child4);
            viewStack.addChild(child5);
            addChild(viewStack);

            tabBar = new TabBar();
            tabBar.dataProvider = viewStack;
            tabBar.percentWidth = 100;
            tabBar.setStyle("fontFamily", "EmbeddedBase02");
            addChildAt(tabBar, 0)
        }
    }
}
</pre>
<p>And finally, if you wanted to use a normal font weight instead of the default bold font weight, you could use the following snippet:</p>
<pre class="code">
&lt;mx:Style&gt;
    @font-face {
        src: local("Base 02");
        fontFamily: EmbeddedBase02;
        fontWeight: normal;
    }

    TabBar {
        fontFamily: EmbeddedBase02;
        tabStyleName: normalTabStyleName;
        selectedTabTextStyleName: normalTabStyleName;
    }

    .normalTabStyleName {
        fontWeight: normal;
    }
&lt;/mx:Style&gt;
</pre>
<p class="alert">Base 02 font by <a href="http://www.stereo-type.net/">www.stereo-type.net</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using an embedded font with the TabBar control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/06/07/using-an-embedded-font-with-the-tabbar-control-in-flex/',contentID: 'post-661',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fontFamily,fontWeight',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/06/07/using-an-embedded-font-with-the-tabbar-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using an embedded font with the Slider controls in Flex</title>
		<link>http://blog.flexexamples.com/2008/06/04/using-an-embedded-font-with-the-slider-controls-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/06/04/using-an-embedded-font-with-the-slider-controls-in-flex/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 06:39:40 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[HSlider]]></category>
		<category><![CDATA[Slider]]></category>
		<category><![CDATA[VSlider]]></category>
		<category><![CDATA[fontFamily]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/04/using-an-embedded-font-with-the-slider-controls-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use an embedded font with the Flex HSlider control by setting the fontFamily and labelStyleName styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HSlider_labelStyleName_fontFamily_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/06/04/using-an-embedded-font-with-the-slider-controls-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; @font-face { src: local("Base 02"); fontFamily: EmbeddedBase02; } .sliderLabelStyleName { [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use an embedded font with the Flex HSlider control by setting the <code>fontFamily</code> and <code>labelStyleName</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-657"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HSlider_labelStyleName_fontFamily_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/06/04/using-an-embedded-font-with-the-slider-controls-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Base 02");
            fontFamily: EmbeddedBase02;
        }

        .sliderLabelStyleName {
            fontFamily: EmbeddedBase02;
        }
    &lt;/mx:Style&gt;

    &lt;mx:HSlider id="slider"
            minimum="0"
            maximum="20"
            value="0"
            labels="[0,5,10,15,20]"
            snapInterval="1"
            tickInterval="1"
            liveDragging="true"
            labelStyleName="sliderLabelStyleName"
            width="200" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/HSlider_labelStyleName_fontFamily_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/HSlider_labelStyleName_fontFamily_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>You can also set the <code>labelStyleName</code> and <code>fontFamily</code> styles using an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HSlider_labelStyleName_fontFamily_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/06/04/using-an-embedded-font-with-the-slider-controls-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Base 02");
            fontFamily: EmbeddedBase02;
        }

        Slider {
            labelStyleName: sliderLabelStyleName;
        }

        .sliderLabelStyleName {
            fontFamily: EmbeddedBase02;
        }
    &lt;/mx:Style&gt;

    &lt;mx:HSlider id="slider"
            minimum="0"
            maximum="20"
            value="0"
            labels="[0,5,10,15,20]"
            snapInterval="1"
            tickInterval="1"
            liveDragging="true"
            width="200" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can also set the <code>labelStyleName</code> and <code>fontFamily</code> styles using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HSlider_labelStyleName_fontFamily_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/06/04/using-an-embedded-font-with-the-slider-controls-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.HSlider;

            [Embed(systemFont="Base 02",
                    fontName="EmbeddedBase02",
                    advancedAntiAliasing="true",
                    mimeType="application/x-font")]
            private var EmbeddedBase02:Class;

            private var slider:HSlider;

            private function init():void {
                var labelStyleName:CSSStyleDeclaration = new CSSStyleDeclaration();
                labelStyleName.setStyle("fontFamily", "EmbeddedBase02");

                StyleManager.setStyleDeclaration(".sliderLabelStyleName", labelStyleName, true);

                slider = new HSlider();
                slider.minimum = 0;
                slider.maximum = 20;
                slider.value = 0;
                slider.labels = [0, 5, 10, 15, 20];
                slider.snapInterval = 1;
                slider.tickInterval = 1;
                slider.setStyle("labelStyleName", "sliderLabelStyleName");
                slider.width = 200;
                addChild(slider);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<p class="alert">Base 02 font by <a href="http://www.stereo-type.net/">www.stereo-type.net</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using an embedded font with the Slider controls in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/06/04/using-an-embedded-font-with-the-slider-controls-in-flex/',contentID: 'post-657',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fontFamily',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/06/04/using-an-embedded-font-with-the-slider-controls-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using an embedded font with the ComboBox control in Flex</title>
		<link>http://blog.flexexamples.com/2008/06/02/using-an-embedded-font-with-the-combobox-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/06/02/using-an-embedded-font-with-the-combobox-control-in-flex/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 06:32:52 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ComboBox]]></category>
		<category><![CDATA[fontFamily]]></category>
		<category><![CDATA[fontWeight]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/02/using-an-embedded-font-with-the-combobox-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use an embedded font with the Flex ComboBox control by setting the fontFamily style.</p> <p></p> <p class="note">By default the ComboBox control&#8217;s label use a bold font weight, whereas the dropdown items use a normal font weight.</p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2008/06/02/using-an-embedded-font-with-the-combobox-control-in-flex/ --&#62; &#60;mx:Application name=&#34;ComboBox_fontFamily_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;top&#34; backgroundColor=&#34;white&#34;&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use an embedded font with the Flex ComboBox control by setting the <code>fontFamily</code> style.</p>
<p><span id="more-655"></span></p>
<p class="note">By default the ComboBox control&#8217;s label use a bold font weight, whereas the dropdown items use a normal font weight.</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2008/06/02/using-an-embedded-font-with-the-combobox-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;ComboBox_fontFamily_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;top&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @font-face {
            src: local(&quot;Base 02&quot;);
            fontFamily: EmbeddedBase02;
            fontWeight: bold;
        }
&nbsp;
        @font-face {
            src: local(&quot;Base 02&quot;);
            fontFamily: EmbeddedBase02;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Array</span> id=<span style="color: #ff0000;">&quot;arr&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;One&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Four&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;Five&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Array</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ComboBox</span> id=<span style="color: #ff0000;">&quot;comboBox&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{arr}&quot;</span></span>
<span style="color: #000000;">            fontFamily=<span style="color: #ff0000;">&quot;EmbeddedBase02&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ComboBox_fontFamily_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/ComboBox_fontFamily_test/bin/main.html" width="100%" height="200"></iframe></p>
<p class="alert">Base 02 font by <a href="http://www.stereo-type.net/">www.stereo-type.net</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using an embedded font with the ComboBox control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/06/02/using-an-embedded-font-with-the-combobox-control-in-flex/',contentID: 'post-655',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fontFamily,fontWeight',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/06/02/using-an-embedded-font-with-the-combobox-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using embedded fonts with the NumericStepper control in Flex</title>
		<link>http://blog.flexexamples.com/2008/05/18/using-embedded-fonts-with-the-numericstepper-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/05/18/using-embedded-fonts-with-the-numericstepper-control-in-flex/#comments</comments>
		<pubDate>Sun, 18 May 2008 17:23:34 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[NumericStepper]]></category>
		<category><![CDATA[fontFamily]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/18/using-embedded-fonts-with-the-numericstepper-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use an embedded font with the Flex NumericStepper control by setting the fontFamily style.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/05/18/using-embedded-fonts-with-the-numericstepper-control-in-flex/ --&#62; &#60;mx:Application name="NumericStepper_fontFamily_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; @font-face { src: local("Base 02"); fontFamily: Base02Embedded; } &#60;/mx:Style&#62; &#60;mx:NumericStepper id="numericStepper" fontFamily="Base02Embedded" fontSize="32" width="100" textAlign="right" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use an embedded font with the Flex NumericStepper control by setting the <code>fontFamily</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-633"></span></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/05/18/using-embedded-fonts-with-the-numericstepper-control-in-flex/ --&gt;
&lt;mx:Application name="NumericStepper_fontFamily_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Base 02");
            fontFamily: Base02Embedded;
        }
    &lt;/mx:Style&gt;

    &lt;mx:NumericStepper id="numericStepper"
            fontFamily="Base02Embedded"
            fontSize="32"
            width="100"
            textAlign="right" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_fontFamily_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_fontFamily_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>You can also set the <code>fontFamily</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:Style&gt;
    @font-face {
        src: local("Base 02");
        fontFamily: Base02Embedded;
    }

    NumericStepper {
        fontFamily: Base02Embedded;
        fontSize: 32;
        textAlign: right;
    }
&lt;/mx:Style&gt;
</pre>
<p>Or, you can set the <code>fontFamily</code> style using ActionScript, as seen in the following snippet:</p>
<pre class="code">
numericStepper.setStyle("fontFamily", "Base02Embedded");
numericStepper.setStyle("fontSize", 32);
numericStepper.setStyle("textAlign", "right");
</pre>
<p>Due to popular demand, here is the &#8220;same&#8221; example, written in ActionScript:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_fontFamily_test_2/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/05/18/using-embedded-fonts-with-the-numericstepper-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:comps="comps.*"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;comps:MyComp id="myComp" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_fontFamily_test_2/bin/srcview/source/comps/MyComp.mxml.html">comps/MyComp.as</a></p>
<pre class="code">
/**
 * http://blog.flexexamples.com/2008/05/18/using-embedded-fonts-with-the-numericstepper-control-in-flex/
 */
package comps {
    import mx.containers.Canvas;
    import mx.controls.NumericStepper;

    public class MyComp extends Canvas {

        [Embed(systemFont="Base 02",
                fontName="Base02Embedded",
                mimeType="application/x-font")]
        public var Base02Embedded:Class;
        public var numericStepper:NumericStepper;

        public function MyComp() {
            super();
            init();
        }

        private function init():void {
            numericStepper = new NumericStepper();
            numericStepper.width = 100;
            numericStepper.setStyle("fontFamily", "Base02Embedded");
            numericStepper.setStyle("fontSize", 32);
            numericStepper.setStyle("textAlign", "right");
            addChild(numericStepper);
        }
    }
}
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_fontFamily_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_fontFamily_test_2/bin/main.html" width="100%" height="150"></iframe></p>
<p class="alert">Base 02 font by <a href="http://www.stereo-type.net/">www.stereo-type.net</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using embedded fonts with the NumericStepper control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/18/using-embedded-fonts-with-the-numericstepper-control-in-flex/',contentID: 'post-633',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fontFamily',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/05/18/using-embedded-fonts-with-the-numericstepper-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using embedded fonts with the Panel container in Flex</title>
		<link>http://blog.flexexamples.com/2008/02/28/using-embedded-fonts-with-the-panel-container-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/02/28/using-embedded-fonts-with-the-panel-container-in-flex/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 05:32:07 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Embed]]></category>
		<category><![CDATA[Panel]]></category>
		<category><![CDATA[fontFamily]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/28/using-embedded-fonts-with-the-panel-container-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use an embedded font with the Flex Panel container so that a Panel container can be rotated or faded without the text &#8220;disappearing&#8221;. The trick here is to set the panel&#8217;s titleStyleName style to a custom style which sets the font family to the embedded font.</p> <p>Full code [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use an embedded font with the Flex Panel container so that a Panel container can be rotated or faded without the text &#8220;disappearing&#8221;. The trick here is to set the panel&#8217;s <code>titleStyleName</code> style to a custom style which sets the font family to the embedded font.</p>
<p>Full code after the jump.</p>
<p><span id="more-533"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Panel_titleStyleName_fontFamily_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/02/28/using-embedded-fonts-with-the-panel-container-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Verdana");
            fontFamily: VerdanaEmbedded;
        }

        Panel {
            titleStyleName: panelTitleStyleName;
        }

        .panelTitleStyleName {
            fontFamily: VerdanaEmbedded;
            fontWeight: normal;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Panel fontFamily="VerdanaEmbedded"
            title="Title"
            status="status"
            width="160"
            height="120"
            rotation="15"&gt;
        &lt;mx:Text text="The quick brown fox jumped over the lazy dog."
                width="100%" /&gt;
        &lt;mx:ControlBar&gt;
            &lt;mx:Label text="ControlBar label" /&gt;
        &lt;/mx:ControlBar&gt;
    &lt;/mx:Panel&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Panel_titleStyleName_fontFamily_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Panel_titleStyleName_fontFamily_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using embedded fonts with the Panel container in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/02/28/using-embedded-fonts-with-the-panel-container-in-flex/',contentID: 'post-533',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fontFamily',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/02/28/using-embedded-fonts-with-the-panel-container-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

