<?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; unicodeRange</title>
	<atom:link href="http://blog.flexexamples.com/tag/unicoderange/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 a custom flex-config.xml file in Flex Builder 3</title>
		<link>http://blog.flexexamples.com/2008/12/21/using-a-custom-flex-configxml-file-in-flex-builder-3/</link>
		<comments>http://blog.flexexamples.com/2008/12/21/using-a-custom-flex-configxml-file-in-flex-builder-3/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 20:19:49 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Compiler]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[Flex Builder 3]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[flex config.xml]]></category>
		<category><![CDATA[load config]]></category>
		<category><![CDATA[unicodeRange]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/12/21/using-a-custom-flex-configxml-file-in-flex-builder-3/</guid>
		<description><![CDATA[<p>The following example shows how you can use a custom configuration file in a Flex Builder Flex project by specifying an additional compiler argument, -load-config.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LoadConfig_fonts_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/12/21/using-a-custom-flex-configxml-file-in-flex-builder-3/ --&#62; &#60;mx:Application name="LoadConfig_fonts_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; @font-face { src: url("assets/ARIAL.TTF"); fontFamily: "ArialEmbedded"; unicodeRange: [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use a custom configuration file in a Flex Builder Flex project by specifying an additional compiler argument, <code>-load-config</code>.</p>
<p>Full code after the jump.</p>
<p><span id="more-908"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LoadConfig_fonts_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/12/21/using-a-custom-flex-configxml-file-in-flex-builder-3/ --&gt;
&lt;mx:Application name="LoadConfig_fonts_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: url("assets/ARIAL.TTF");
            fontFamily: "ArialEmbedded";
            unicodeRange: "englishRange";
        }

        Text {
            fontFamily: "ArialEmbedded";
            fontSize: 32;
            color: red;
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="alpha:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0.0"
                        maximum="1.0"
                        value="1.0"
                        snapInterval="0.05"
                        tickInterval="0.1"
                        liveDragging="true" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Text id="txt" width="300" alpha="{slider.value}"&gt;
        &lt;mx:text&gt;The quick brown fox jumps over the lazy dog. 1234567890 &#x00A9;&lt;/mx:text&gt;
    &lt;/mx:Text&gt;

&lt;/mx:Application&gt;
</pre>
<p>Next, create a custom configuration XML file named fontConfig.xml and save it in a /config/ subdirectory in your project&#8217;s /src/ directory. The folder structure isn&#8217;t important, but it helps keep the source code and configuration files separated. The fontConfig.xml file is a modified version of the flex-config.xml file found in the Flex SDK&#8217;s /frameworks/ directory. In this example we simply specify a single named font range which specifies a unicode range of U+0020 (<em>space</em>) to U+007E (~).</p>
<p class="download"><a href="">config/fontConfig.xml</a></p>
<pre class="code">
&lt;?xml version="1.0"?&gt;
&lt;flex-config&gt;
   &lt;compiler&gt;
      &lt;fonts&gt;
          &lt;!-- Defines ranges that can be used across multiple font-face declarations. --&gt;
          &lt;!-- See flash-unicode-table.xml for more examples. --&gt;
          &lt;languages&gt;
              &lt;language-range&gt;
                  &lt;lang&gt;englishRange&lt;/lang&gt;
                  &lt;range&gt;U+0020-U+007E&lt;/range&gt;
              &lt;/language-range&gt;
          &lt;/languages&gt;
      &lt;/fonts&gt;
   &lt;/compiler&gt;
&lt;/flex-config&gt;
</pre>
<p>Finally, in Flex Builder, right click on the Flex Project folder in the Flex Navigator and select Properties from the context menu. Select the Flex Compiler section of the dialog menu and in the <em>Additional compiler arguments:</em> text box add the following text:</p>
<blockquote><p>
-load-config+=config/fontConfig.xml
</p></blockquote>
<p><img src="http://blog.flexexamples.com/wp-content/uploads/LoadConfig_fonts_test/Figure1.jpg" /><br />
<strong>Figure 1.</strong> Additional compiler arguments.</p>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/LoadConfig_fonts_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/LoadConfig_fonts_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using a custom flex-config.xml file in Flex Builder 3 on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/12/21/using-a-custom-flex-configxml-file-in-flex-builder-3/',contentID: 'post-908',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'flex config.xml,load config,unicodeRange',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/12/21/using-a-custom-flex-configxml-file-in-flex-builder-3/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

