<?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>indieas &#187; width</title>
	<atom:link href="http://www.indieas.org/tag/width/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indieas.org</link>
	<description>independent actionscript developer team</description>
	<lastBuildDate>Tue, 19 Oct 2010 13:43:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Problem with TextField.textWidth/TextField.width</title>
		<link>http://www.indieas.org/2009/08/problem-with-textfield-textwidthtextfield-width/</link>
		<comments>http://www.indieas.org/2009/08/problem-with-textfield-textwidthtextfield-width/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 10:12:25 +0000</pubDate>
		<dc:creator>mich</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[textfield]]></category>
		<category><![CDATA[width]]></category>

		<guid isPermaLink="false">http://www.indieas.org/?p=22</guid>
		<description><![CDATA[The problem: Recently I struggled over another problem with the TextField where the textWidth / width was not calculated right. On the screenshot you can see textfields stacked from the left to the right corresponding to the width of the textfield. If you look closely to the borders you see that the leading and tailing [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The problem:</strong></p>
<p>Recently I struggled over another problem with the TextField where the textWidth / width was not calculated right.</p>
<p><img class="alignnone size-full wp-image-24" title="Picture" src="http://www.indieas.org/wp-content/uploads/2009/08/Picture.png" alt="Picture" width="600" height="34" /></p>
<p>On the screenshot you can see textfields stacked from the left to the right corresponding to the width of the textfield. If you look closely to the borders you see that the leading and tailing spaces around the words are not equal at all. Especially at the word &#8220;Newsletter&#8221; the tailing space too small. The texfield was setup like this;</p>
<pre class="brush: as3; title: ; notranslate">
label.autoSize = TextFieldAutoSize.LEFT;
label.wordWrap = false;
label.multiline = false;
label.antiAliasType = AntiAliasType.ADVANCED;
label.gridFitType = GridFitType.PIXEL;
label.embedFonts = true;
label.border = true;
var test:TextFormat = new TextFormat();
test.kerning = true;
test.font = &quot;Futura&quot;;
label.setTextFormat( test );
</pre>
<p><strong>The solution:</strong></p>
<p>It seems that this is a flash bug and you can get over this by changing the <strong>GridFitType.PIXEL</strong> to<strong> GridFitType.SUBPIXEL</strong>.<br />
The resulting textfields look like this;</p>
<p><img class="alignnone size-full wp-image-23" title="Picture 1" src="http://www.indieas.org/wp-content/uploads/2009/08/Picture-1.png" alt="Picture 1" width="586" height="33" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.indieas.org/2009/08/problem-with-textfield-textwidthtextfield-width/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

