<?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; systemFont</title>
	<atom:link href="http://blog.flexexamples.com/tag/systemfont/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>Embedding fonts in a Flex application using Embed metadata (redux)</title>
		<link>http://blog.flexexamples.com/2008/04/01/embedding-fonts-in-a-flex-application-using-embed-metadata-redux/</link>
		<comments>http://blog.flexexamples.com/2008/04/01/embedding-fonts-in-a-flex-application-using-embed-metadata-redux/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 06:59:26 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Embed]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[advancedAntiAliasing]]></category>
		<category><![CDATA[embeddedFontList]]></category>
		<category><![CDATA[mimeType]]></category>
		<category><![CDATA[systemFont]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/01/embedding-fonts-in-a-flex-application-using-embed-metadata-redux/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/02/07/embedding-fonts-in-a-flex-application-using-embed-metadata/">&#8220;Embedding fonts in a Flex application using Embed metadata&#8221;</a>, we saw how you could embed fonts using the [Embed] metadata with the source attribute.</p> <p>The following example shows how you can embed system fonts in a Flex application using the [Embed] metadata with the systemFont attribute.</p> <p>Full code after the [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/02/07/embedding-fonts-in-a-flex-application-using-embed-metadata/">&#8220;Embedding fonts in a Flex application using Embed metadata&#8221;</a>, we saw how you could embed fonts using the [Embed] metadata with the <code>source</code> attribute.</p>
<p>The following example shows how you can embed system fonts in a Flex application using the [Embed] metadata with the <code>systemFont</code> attribute.</p>
<p>Full code after the jump.</p>
<p><span id="more-580"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Embed_systemFont_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/04/01/embedding-fonts-in-a-flex-application-using-embed-metadata-redux/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        .regularFontStyle {
            fontFamily: regularFont;
        }

        .italicFontStyle {
            fontFamily: italicFont;
            fontStyle: italic;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.Alert;
            import mx.utils.ObjectUtil;

            [Bindable]
            [Embed("bulletWarning.png")]
            private var bulletWarningIcon:Class;

            [Embed(systemFont="Tahoma",
                    fontName="regularFont",
                    mimeType="application/x-font")]
            private var font1:Class;

            [Embed(systemFont="Tahoma",
                    fontName="italicFont",
                    fontStyle="italic",
                    advancedAntiAliasing="true",
                    mimeType="application/x-font")]
            private var font2:Class;

            private function displayEmbeddedFont(name:String):void {
                var font:Object = systemManager.embeddedFontList[name];
                Alert.show(ObjectUtil.toString(font), name + ":");
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Form&gt;
        &lt;mx:FormItem label="regularFont:" direction="horizontal"&gt;
            &lt;mx:Label id="lbl1"
                    text="The quick brown fox jumped over the lazy dog."
                    styleName="regularFontStyle" /&gt;
            &lt;mx:Image source="{bulletWarningIcon}"
                    click="displayEmbeddedFont('regularFont');" /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="italicFont:" direction="horizontal"&gt;
            &lt;mx:Label id="lbl2"
                    text="The quick brown fox jumped over the lazy dog."
                    styleName="italicFontStyle" /&gt;
            &lt;mx:Image source="{bulletWarningIcon}"
                    click="displayEmbeddedFont('italicFont');" /&gt;
        &lt;/mx:FormItem&gt;
    &lt;/mx:Form&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Embed_systemFont_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/Embed_systemFont_test/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Embedding fonts in a Flex application using Embed metadata (redux) on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/01/embedding-fonts-in-a-flex-application-using-embed-metadata-redux/',contentID: 'post-580',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'advancedAntiAliasing,embeddedFontList,mimeType,systemFont',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/04/01/embedding-fonts-in-a-flex-application-using-embed-metadata-redux/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

