<?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; fontSharpness</title>
	<atom:link href="http://blog.flexexamples.com/tag/fontsharpness/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>Setting the font sharpness for a Label control in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 06:05:01 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Label]]></category>
		<category><![CDATA[fontAntiAliasType]]></category>
		<category><![CDATA[fontSharpness]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the font sharpness on a Flex Label control by setting the fontSharpness and fontAntiAliasType styles.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/ --&#62; &#60;mx:Application name="Label_fontSharpness_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; @font-face { src: local("Arial"); fontFamily: ArialEmbedded; } @font-face { src: local("Base 02"); fontFamily: Base02Embedded; } &#60;/mx:Style&#62; &#60;mx:ApplicationControlBar dock="true"&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the font sharpness on a Flex Label control by setting the <code>fontSharpness</code> and <code>fontAntiAliasType</code> styles.</p>
<p><span id="more-756"></span></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/ --&gt;
&lt;mx:Application name="Label_fontSharpness_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;
        }

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

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="fontFamily:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        dataProvider="[ArialEmbedded,Base02Embedded]" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="fontSharpness:" direction="horizontal"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="-400"
                        maximum="400"
                        value="0"
                        snapInterval="10"
                        tickInterval="50"
                        liveDragging="true" /&gt;
                &lt;mx:Label text="{slider.value}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Label id="lbl"
            text="The quick brown fox jumped over the lazy dog."
            fontFamily="{comboBox.selectedItem}"
            fontSize="16"
            fontAntiAliasType="advanced"
            fontSharpness="{slider.value}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontSharpness_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/Label_fontSharpness_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>You can also set the <code>fontSharpness</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/Label_fontSharpness_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/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/ --&gt;
&lt;mx:Application name="Label_fontSharpness_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;
        }

        Label {
            fontAntiAliasType: advanced;
            fontFamily: Base02Embedded;
            fontSize: 16;
            fontSharpness: 400;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Label id="lbl"
            text="The quick brown fox jumped over the lazy dog." /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>fontSharpness</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontSharpness_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/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/ --&gt;
&lt;mx:Application name="Label_fontSharpness_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;
        }

        @font-face {
            src: local("Base 02");
            fontFamily: Base02Embedded;
        }

        .myLabel {
            fontAntiAliasType: advanced;
            fontFamily: ArialEmbedded;
            fontSize: 16;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.ListEvent;
            import mx.events.SliderEvent;

            private function comboBox_change(evt:ListEvent):void {
                lbl.setStyle("fontFamily", comboBox.selectedItem);
            }

            private function slider_change(evt:SliderEvent):void {
                lbl.setStyle("fontSharpness", evt.value);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="fontFamily:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        dataProvider="[ArialEmbedded,Base02Embedded]"
                        change="comboBox_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="fontSharpness:" direction="horizontal"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="-400"
                        maximum="400"
                        value="0"
                        snapInterval="10"
                        tickInterval="50"
                        liveDragging="true"
                        change="slider_change(event);" /&gt;
                &lt;mx:Label text="{slider.value}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Label id="lbl"
            text="The quick brown fox jumped over the lazy dog."
            styleName="myLabel" /&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: 'Setting the font sharpness for a Label control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/',contentID: 'post-756',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fontAntiAliasType,fontSharpness',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/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting a font&#8217;s anti-alias type, sharpness, thickness and grid fit type in Flex</title>
		<link>http://blog.flexexamples.com/2007/10/24/setting-a-fonts-anti-alias-type-sharpness-thickness-and-grid-fit-type-in-flex/</link>
		<comments>http://blog.flexexamples.com/2007/10/24/setting-a-fonts-anti-alias-type-sharpness-thickness-and-grid-fit-type-in-flex/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 03:43:45 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Fonts]]></category>
		<category><![CDATA[fontAntiAliasType]]></category>
		<category><![CDATA[fontGridFitType]]></category>
		<category><![CDATA[fontSharpness]]></category>
		<category><![CDATA[fontThickness]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/24/setting-a-fonts-anti-alias-type-sharpness-thickness-and-grid-fit-type-in-flex/</guid>
		<description><![CDATA[<p>The following example shows you how to change an embedded font&#8217;s appearance by setting the fontAntiAliasType style, fontSharpness style, fontThickness style, and fontGridFitType style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontAntiAliasType_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/10/24/setting-a-fonts-anti-alias-type-sharpness-thickness-and-grid-fit-type-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("Arial"); fontFamily: "ArialEmbedded"; } Label { [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how to change an embedded font&#8217;s appearance by setting the <code>fontAntiAliasType</code> style, <code>fontSharpness</code> style, <code>fontThickness</code> style, and <code>fontGridFitType</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-252"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontAntiAliasType_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/10/24/setting-a-fonts-anti-alias-type-sharpness-thickness-and-grid-fit-type-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("Arial");
            fontFamily: "ArialEmbedded";
        }

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

    &lt;mx:Array id="antiAliasTypes"&gt;
        &lt;mx:Object label="normal" /&gt;
        &lt;mx:Object label="advanced" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:Array id="gridFitTypes"&gt;
        &lt;mx:Object label="none" /&gt;
        &lt;mx:Object label="pixel" /&gt;
        &lt;mx:Object label="subpixel" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:Boolean id="isAdvanced"&gt;
        {antiAliasTypeComboBox.selectedIndex == 1}
    &lt;/mx:Boolean&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form&gt;
            &lt;mx:FormItem label="fontSize:"&gt;
                &lt;mx:HSlider id="sizeSlider"
                        minimum="6"
                        maximum="24"
                        value="10"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="1" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="rotation:"&gt;
                &lt;mx:HSlider id="rotationSlider"
                        minimum="-3"
                        maximum="3"
                        value="0"
                        liveDragging="true"
                        snapInterval="0.1"
                        tickInterval="1" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="fontAntiAliasType:"&gt;
                &lt;mx:ComboBox id="antiAliasTypeComboBox"
                        dataProvider="{antiAliasTypes}" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="fontSharpness:"
                    enabled="{isAdvanced}"&gt;
                &lt;mx:HSlider id="sharpnessSlider"
                        minimum="-400"
                        maximum="400"
                        value="0"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="20" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="fontThickness:"
                    enabled="{isAdvanced}"&gt;
                &lt;mx:HSlider id="thicknessSlider"
                        minimum="-200"
                        maximum="200"
                        value="0"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="10" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="fontGridFitType:"
                    enabled="{isAdvanced}"&gt;
                &lt;mx:ComboBox id="gridFitTypeComboBox"
                        dataProvider="{gridFitTypes}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Label id="lbl"
            text="The quick brown fox jumped over the lazy dog."
            fontSize="{sizeSlider.value}"
            fontAntiAliasType="{antiAliasTypeComboBox.selectedItem.label}"
            fontSharpness="{sharpnessSlider.value}"
            fontThickness="{thicknessSlider.value}"
            fontGridFitType="{gridFitTypeComboBox.selectedItem.label}"
            rotation="{rotationSlider.value}"
            truncateToFit="false" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontAntiAliasType_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/Label_fontAntiAliasType_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting a font\&#039;s anti-alias type, sharpness, thickness and grid fit type in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/10/24/setting-a-fonts-anti-alias-type-sharpness-thickness-and-grid-fit-type-in-flex/',contentID: 'post-252',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fontAntiAliasType,fontGridFitType,fontSharpness,fontThickness',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/2007/10/24/setting-a-fonts-anti-alias-type-sharpness-thickness-and-grid-fit-type-in-flex/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

