<?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>Aaron L'Heureux &#187; Tips</title>
	<atom:link href="http://www.dotstrosity.net/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotstrosity.net</link>
	<description>A Portfolio of Work and the Related Mess</description>
	<lastBuildDate>Thu, 22 Mar 2012 17:49:32 +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>Flash CS5 font embedding &#8211; it&#8217;s totally different&#8230;</title>
		<link>http://www.dotstrosity.net/2010/05/10/flash-cs5-font-embedding-its-totally-different/</link>
		<comments>http://www.dotstrosity.net/2010/05/10/flash-cs5-font-embedding-its-totally-different/#comments</comments>
		<pubDate>Mon, 10 May 2010 14:37:54 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[embedding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flash cs5]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[font embedding]]></category>
		<category><![CDATA[fonts]]></category>

		<guid isPermaLink="false">http://www.dotstrosity.net/?p=347</guid>
		<description><![CDATA[Flash CS5 breaks font embedding in ActionScript the way people have been doing it for a while. Here's how to get around it.]]></description>
			<content:encoded><![CDATA[<h3>Update</h3>
<p>This post was originally written when CS5 first landed and the way I had been previously setting up font embedding stopped working. I was unaware, at that time, of the ability to enumerate over the embedded fonts that would completely eschew the need to reference something like actual TTF data in an external application (my initial comments). At this point I suggest you take a look through the more recent comments if the below suggestions do not work for you as there is some useful information throughout.</p>
<hr />
<h3>Original Post:</h3>
<p>&nbsp;</p>
<p>(&#8230;and breaks the way everyone has been doing it with ActionScript).</p>
<p>Basically, no longer do you embed a font like this:</p>
<p><a href="http://www.dotstrosity.net/wp-content/uploads/2010/05/Screen-shot-2010-05-10-at-10.26.48-AM.png" rel="shadowbox[sbpost-347];player=img;"><img class="aligncenter size-medium wp-image-348" title="Screen shot 2010-05-10 at 10.26.48 AM" src="http://www.dotstrosity.net/wp-content/uploads/2010/05/Screen-shot-2010-05-10-at-10.26.48-AM-300x46.png" alt="" width="300" height="46" /></a></p>
<p>Flash CS5 brings along with it a new item in the Text menu for your FLA. Simply select Text, and go down to Font Embedding:</p>
<p><a href="http://www.dotstrosity.net/wp-content/uploads/2010/05/Screen-shot-2010-05-10-at-10.28.11-AM.png" rel="shadowbox[sbpost-347];player=img;"><img class="aligncenter size-full wp-image-349" title="Screen shot 2010-05-10 at 10.28.11 AM" src="http://www.dotstrosity.net/wp-content/uploads/2010/05/Screen-shot-2010-05-10-at-10.28.11-AM.png" alt="" width="258" height="270" /></a></p>
<p>Once selected, hit the plus to create a new font entry, and customize it as you desire (weights, embedded glyphs, etc). If you don&#8217;t need to reference it from ActionScript, you&#8217;re finished, but if you do, read on&#8230;</p>
<p><a href="http://www.dotstrosity.net/wp-content/uploads/2010/05/Screen-shot-2010-05-10-at-10.30.36-AM.png" rel="shadowbox[sbpost-347];player=img;"><img class="aligncenter size-medium wp-image-351" title="Screen shot 2010-05-10 at 10.30.36 AM" src="http://www.dotstrosity.net/wp-content/uploads/2010/05/Screen-shot-2010-05-10-at-10.30.36-AM-300x176.png" alt="" width="300" height="176" /></a></p>
<p><span id="more-347"></span>Hit the ActionScript tab, and check off Export for ActionScript (if the base class is not set, type in flash.text.Font).</p>
<p><a href="http://www.dotstrosity.net/wp-content/uploads/2010/05/Screen-shot-2010-05-10-at-10.30.04-AM.png" rel="shadowbox[sbpost-347];player=img;"><img class="aligncenter size-medium wp-image-350" title="Screen shot 2010-05-10 at 10.30.04 AM" src="http://www.dotstrosity.net/wp-content/uploads/2010/05/Screen-shot-2010-05-10-at-10.30.04-AM-300x176.png" alt="" width="300" height="176" /></a></p>
<p>Now you&#8217;re font is embedded with the glyphs of your choosing, but you&#8217;re not finished. Now you need to include this code (replace NumberFont with your linkage name from before):</p>
<blockquote><p>import flash.text.Font;<br />
&#8230;<br />
Font.registerFont(NumberFont);</p></blockquote>
<p>Now you can reference your font in a variety of ways, but not with the name &#8220;NumberFont&#8221;. Since I embedded Arial Bold, if you use a stylesheet it should be:</p>
<blockquote><p>font-family: &#8220;Arial&#8221; (ActionScript property: fontFamily = &#8220;Arial&#8221;)<br />
and<br />
font-weight: &#8220;bold&#8221; (ActionScript property: fontWeight = &#8220;bold&#8221;)</p></blockquote>
<p>If you&#8217;re using a TextFormat, it should be:</p>
<blockquote><p>new TextFormat(&#8220;Arial&#8221;, 10, 0&#215;000000, true)</p></blockquote>
<p>Would have been nice to know this change was happening (specifically that the old way would stop working) rather than pop open an FLA and be blindsided by it, but it&#8217;s an easy fix and a nicer implementation as far as I&#8217;m concerned. That said, this probably creates problems for people who want to be able to build without Flash and keep their code portable for people who do build with Flash.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotstrosity.net/2010/05/10/flash-cs5-font-embedding-its-totally-different/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
	</channel>
</rss>

