<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Embedding fonts in Flash CS4 using ActionScript</title>
	<atom:link href="http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/</link>
	<description>A bunch of ActionScript 2.0 and ActionScript 3.0 examples*</description>
	<lastBuildDate>Sun, 21 Mar 2010 00:56:04 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: HdotNET</title>
		<link>http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/comment-page-1/#comment-653</link>
		<dc:creator>HdotNET</dc:creator>
		<pubDate>Wed, 03 Mar 2010 17:33:26 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=32#comment-653</guid>
		<description>I know I&#039;m pretty late to this party but after reading what seems the entire internet I think I&#039;ve solved a problem that many people may come up against.

If your embedded font is not appearing, ensure that you set the defaultTextFormat property of your TextField BEFORE you set the text property.

GOOD:
&lt;code&gt;
var format:TextFormat = new TextFormat();
format.font=EmbeddedFont.fontName;
format.color=0x000000;
var txtObj:TextField = new TextField();
txtObj.embedFonts=true;
txtObj.defaultTextFormat=format;
txtObj.text=&#039;Hello World!&#039;;
&lt;/code&gt;

BAD

&lt;code&gt;
var format:TextFormat = new TextFormat();
format.font= EmbeddedFont.fontName;
format.color=0xffffff;
var txtObj:TextField = new TextField();
txtObj.embedFonts=true;
txtObj.text=&#039;Hello World!&#039;;
txtObj.defaultTextFormat=format;
&lt;/code&gt;

If you don&#039;t you will waste several hours of your life wondering why your damn text isn&#039;t appearing.</description>
		<content:encoded><![CDATA[<p>I know I&#8217;m pretty late to this party but after reading what seems the entire internet I think I&#8217;ve solved a problem that many people may come up against.</p>
<p>If your embedded font is not appearing, ensure that you set the defaultTextFormat property of your TextField BEFORE you set the text property.</p>
<p>GOOD:<br />
<code><br />
var format:TextFormat = new TextFormat();<br />
format.font=EmbeddedFont.fontName;<br />
format.color=0x000000;<br />
var txtObj:TextField = new TextField();<br />
txtObj.embedFonts=true;<br />
txtObj.defaultTextFormat=format;<br />
txtObj.text='Hello World!';<br />
</code></p>
<p>BAD</p>
<p><code><br />
var format:TextFormat = new TextFormat();<br />
format.font= EmbeddedFont.fontName;<br />
format.color=0xffffff;<br />
var txtObj:TextField = new TextField();<br />
txtObj.embedFonts=true;<br />
txtObj.text='Hello World!';<br />
txtObj.defaultTextFormat=format;<br />
</code></p>
<p>If you don&#8217;t you will waste several hours of your life wondering why your damn text isn&#8217;t appearing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lordB8r</title>
		<link>http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/comment-page-1/#comment-605</link>
		<dc:creator>lordB8r</dc:creator>
		<pubDate>Tue, 27 Oct 2009 03:39:14 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=32#comment-605</guid>
		<description>not sure if it&#039;ll help, but i&#039;ve been trying for a while to embed some custom fonts that a client wanted to use.  Not finding an easy way to get the font&#039;s i have from font-book (on a mac), i created a css that uses src:local(&#039;assets/fonts/customFont&#039;).  Then I created a swf from the css, and then used that in a global{ src:url(&quot;assets/fonts/customFont.swf&quot;);
    fontFamily: &quot;customFont&quot;;}
I have no idea if that&#039;ll help anyone else, but suddenly i was finally seeing my fonts in all of my skinned components...</description>
		<content:encoded><![CDATA[<p>not sure if it&#8217;ll help, but i&#8217;ve been trying for a while to embed some custom fonts that a client wanted to use.  Not finding an easy way to get the font&#8217;s i have from font-book (on a mac), i created a css that uses src:local(&#8216;assets/fonts/customFont&#8217;).  Then I created a swf from the css, and then used that in a global{ src:url(&#8220;assets/fonts/customFont.swf&#8221;);<br />
    fontFamily: &#8220;customFont&#8221;;}<br />
I have no idea if that&#8217;ll help anyone else, but suddenly i was finally seeing my fonts in all of my skinned components&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shanti</title>
		<link>http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/comment-page-1/#comment-585</link>
		<dc:creator>Shanti</dc:creator>
		<pubDate>Fri, 04 Sep 2009 04:38:46 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=32#comment-585</guid>
		<description>Thank You so much! This is what I wanted!!!</description>
		<content:encoded><![CDATA[<p>Thank You so much! This is what I wanted!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: martin</title>
		<link>http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/comment-page-1/#comment-584</link>
		<dc:creator>martin</dc:creator>
		<pubDate>Tue, 25 Aug 2009 21:29:44 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=32#comment-584</guid>
		<description>I want to embed my font with the following code: 
[Embed(source = &quot;../../assets/fonts/HelveticaBold.swf&quot;, fontFamily = &quot;HelveticaNeue LT 75 Bold&quot;)] 
public static var HelveticaBold:Class;
....
and the code used above. But I don&#039;t see my text. Whats wrong?</description>
		<content:encoded><![CDATA[<p>I want to embed my font with the following code:<br />
[Embed(source = "../../assets/fonts/HelveticaBold.swf", fontFamily = "HelveticaNeue LT 75 Bold")]<br />
public static var HelveticaBold:Class;<br />
&#8230;.<br />
and the code used above. But I don&#8217;t see my text. Whats wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jayesh</title>
		<link>http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/comment-page-1/#comment-576</link>
		<dc:creator>jayesh</dc:creator>
		<pubDate>Tue, 18 Aug 2009 10:00:20 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=32#comment-576</guid>
		<description>found it &lt;a href=&quot;http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WSFD77A256-0DE1-46c7-86FB-CC4A8AE2EAA6.html#WS5F9A13A1-03CB-4a01-B467-0272D23A12D0&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.

Excerpt below - 
&lt;cite&gt;
You add metadata to ActionScript on the line immediately preceding the line of code that the metadata applies to. The compiler then takes the metadata into account when compiling the line of code that follows it. 

&lt;code&gt;
[Embed(&quot;../button_up.png&quot;)]
private var buttonUpImage:Class;
&lt;/code&gt;
The [Embed] metadata tag tells the compiler to embed the file named button_up.png in the SWF file and that the file should be associated with the variable named buttonUpImage. 
&lt;/cite&gt;</description>
		<content:encoded><![CDATA[<p>found it <a href="http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WSFD77A256-0DE1-46c7-86FB-CC4A8AE2EAA6.html#WS5F9A13A1-03CB-4a01-B467-0272D23A12D0" rel="nofollow">here</a>.</p>
<p>Excerpt below &#8211;<br />
<cite><br />
You add metadata to ActionScript on the line immediately preceding the line of code that the metadata applies to. The compiler then takes the metadata into account when compiling the line of code that follows it. </p>
<p><code><br />
[Embed("../button_up.png")]<br />
private var buttonUpImage:Class;<br />
</code><br />
The [Embed] metadata tag tells the compiler to embed the file named button_up.png in the SWF file and that the file should be associated with the variable named buttonUpImage.<br />
</cite></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jayesh</title>
		<link>http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/comment-page-1/#comment-575</link>
		<dc:creator>jayesh</dc:creator>
		<pubDate>Tue, 18 Aug 2009 08:27:36 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=32#comment-575</guid>
		<description>How can we embed multiple fonts? I tried having two lines of Embed with different font-sources and Class names. It says - An Embed variable must not have an existing value. Any clue?

&lt;code&gt;
		[Embed(source = &quot;fonts/isocteur.ttf&quot;, fontFamily = &quot;ISOC&quot;)]
		[Embed(source = &quot;fonts/Helvetica.ttf&quot;, fontFamily = &quot;HELV&quot;)]
&lt;/code&gt;
-jayesh</description>
		<content:encoded><![CDATA[<p>How can we embed multiple fonts? I tried having two lines of Embed with different font-sources and Class names. It says &#8211; An Embed variable must not have an existing value. Any clue?</p>
<p><code><br />
		[Embed(source = "fonts/isocteur.ttf", fontFamily = "ISOC")]<br />
		[Embed(source = "fonts/Helvetica.ttf", fontFamily = "HELV")]<br />
</code><br />
-jayesh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adriaan</title>
		<link>http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/comment-page-1/#comment-569</link>
		<dc:creator>adriaan</dc:creator>
		<pubDate>Sat, 01 Aug 2009 10:18:23 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=32#comment-569</guid>
		<description>PS: I do with with &quot;Verdana&quot; and it works...</description>
		<content:encoded><![CDATA[<p>PS: I do with with &#8220;Verdana&#8221; and it works&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adriaan</title>
		<link>http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/comment-page-1/#comment-568</link>
		<dc:creator>adriaan</dc:creator>
		<pubDate>Sat, 01 Aug 2009 10:12:35 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=32#comment-568</guid>
		<description>I&#039;ve been embedding fonts in my Flash projects for years on my PC.  Now I&#039;m on a Mac and I can&#039;t embed as I once used to.  Here&#039;s what I&#039;m doing:

Installed OpenType version of &quot;Akzidenz Grotesk Berthold&quot; (my client&#039;s font of choice) into my Computer library in Font Book.  Then I use an external SWF with the Font added via &quot;New Font&quot; in the library.  I select Akzidenz and make the export name &quot;BertholdAkzidenzGrotesk&quot;.  In the first frame of this SWF I code:
&lt;code&gt;
import flash.text.Font;
Font.registerFont( BertholdAkzidenzGrotesk );
&lt;/code&gt;
On my PC sometimes I had trouble getting the font to load so I&#039;d need to use the actual TTF file name on a TextField, as in:
&lt;code&gt;
var format : TextFormat = new TextFormat();
format.font = &quot;AkzidGroCFFLig&quot;;
&lt;/code&gt;

But this doesn&#039;t work, nor does:
&lt;code&gt;
var format : TextFormat = new TextFormat();
format.font = &quot;BertholdAkzidenzGrotesk&quot;;
&lt;/code&gt;

Nor does:
&lt;code&gt;
var format : TextFormat = new TextFormat();
format.font = &quot;Berthold Akzidenz Grotesk&quot;;
&lt;/code&gt;

This would always work on my PC (I&#039;ve developed websites for Nokia using this method)...What am I suddenly doing wrong?

Thanks for your help.

Best,
adriaan</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been embedding fonts in my Flash projects for years on my PC.  Now I&#8217;m on a Mac and I can&#8217;t embed as I once used to.  Here&#8217;s what I&#8217;m doing:</p>
<p>Installed OpenType version of &#8220;Akzidenz Grotesk Berthold&#8221; (my client&#8217;s font of choice) into my Computer library in Font Book.  Then I use an external SWF with the Font added via &#8220;New Font&#8221; in the library.  I select Akzidenz and make the export name &#8220;BertholdAkzidenzGrotesk&#8221;.  In the first frame of this SWF I code:<br />
<code><br />
import flash.text.Font;<br />
Font.registerFont( BertholdAkzidenzGrotesk );<br />
</code><br />
On my PC sometimes I had trouble getting the font to load so I&#8217;d need to use the actual TTF file name on a TextField, as in:<br />
<code><br />
var format : TextFormat = new TextFormat();<br />
format.font = "AkzidGroCFFLig";<br />
</code></p>
<p>But this doesn&#8217;t work, nor does:<br />
<code><br />
var format : TextFormat = new TextFormat();<br />
format.font = "BertholdAkzidenzGrotesk";<br />
</code></p>
<p>Nor does:<br />
<code><br />
var format : TextFormat = new TextFormat();<br />
format.font = "Berthold Akzidenz Grotesk";<br />
</code></p>
<p>This would always work on my PC (I&#8217;ve developed websites for Nokia using this method)&#8230;What am I suddenly doing wrong?</p>
<p>Thanks for your help.</p>
<p>Best,<br />
adriaan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sein</title>
		<link>http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/comment-page-1/#comment-562</link>
		<dc:creator>Sein</dc:creator>
		<pubDate>Fri, 24 Jul 2009 06:53:59 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=32#comment-562</guid>
		<description>AMAZING! IT did the job in my case!</description>
		<content:encoded><![CDATA[<p>AMAZING! IT did the job in my case!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://actionscriptexamples.com/2008/11/24/embedding-fonts-in-flash-cs4-using-actionscript/comment-page-1/#comment-549</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Thu, 02 Jul 2009 14:35:59 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=32#comment-549</guid>
		<description>Victor,

Out of curiosity, what is the Cyrillic font bug in CS4?

Peter</description>
		<content:encoded><![CDATA[<p>Victor,</p>
<p>Out of curiosity, what is the Cyrillic font bug in CS4?</p>
<p>Peter</p>
]]></content:encoded>
	</item>
</channel>
</rss>
