<?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: AS3 Runtime Font Loading</title>
	<atom:link href="http://nochump.com/blog/archives/20/feed" rel="self" type="application/rss+xml" />
	<link>http://nochump.com/blog/archives/20</link>
	<description>my density has bought me to you</description>
	<lastBuildDate>Wed, 19 Mar 2008 13:12:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Paolo Iulita</title>
		<link>http://nochump.com/blog/archives/20/comment-page-1#comment-24283</link>
		<dc:creator>Paolo Iulita</dc:creator>
		<pubDate>Wed, 12 Mar 2008 09:46:34 +0000</pubDate>
		<guid isPermaLink="false">http://nochump.com/blog/?p=20#comment-24283</guid>
		<description>Here is a system to embed fonts WITHOUT using swf

http://blog.paoloiulita.it/2008/03/11/as3-embedding-font-with-code-only/

hope you like

enjoy!</description>
		<content:encoded><![CDATA[<p>Here is a system to embed fonts WITHOUT using swf</p>
<p><a href="http://blog.paoloiulita.it/2008/03/11/as3-embedding-font-with-code-only/" rel="nofollow">http://blog.paoloiulita.it/2008/03/11/as3-embedding-font-with-code-only/</a></p>
<p>hope you like</p>
<p>enjoy!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sprit3 &#38;raquo; Blog Archive &#38;raquo; nochump.com Â» Blog Archive Â» AS3 Runtime Font Loading</title>
		<link>http://nochump.com/blog/archives/20/comment-page-1#comment-23581</link>
		<dc:creator>sprit3 &#38;raquo; Blog Archive &#38;raquo; nochump.com Â» Blog Archive Â» AS3 Runtime Font Loading</dc:creator>
		<pubDate>Fri, 07 Mar 2008 13:18:46 +0000</pubDate>
		<guid isPermaLink="false">http://nochump.com/blog/?p=20#comment-23581</guid>
		<description>[...] nochump.com Â» Blog Archive Â» AS3 Runtime Font Loading [...]</description>
		<content:encoded><![CDATA[<p>[...] nochump.com Â» Blog Archive Â» AS3 Runtime Font Loading [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: michel</title>
		<link>http://nochump.com/blog/archives/20/comment-page-1#comment-15707</link>
		<dc:creator>michel</dc:creator>
		<pubDate>Wed, 16 Jan 2008 14:28:11 +0000</pubDate>
		<guid isPermaLink="false">http://nochump.com/blog/?p=20#comment-15707</guid>
		<description>@ dchang:
Very nice topic and helpful solutions, thanks!
Now, I&#039;ve been working on the problem myself for a while because I was used to creating shared font libs in the IDE.
However, when creating a font lib using the Flex SDK as you suggest, would it not be easier to directly register the fonts in the constructor of the FontLibrary?

That way you wouldn&#039;t need to care about getting definitions and fishing for included font classes you might not even know the class names of (maybe someone else created the font class and didn&#039;t document it properly :) ). Moreover, your application wouldn&#039;t even need to know a thing about the fonts if the style definitions were included in an external style sheet that was loaded and applied as well.
VoilÃ , no more font mess in the application: you load the lib, you load the style sheet and you create textfields and apply styles without knowing anything about fonts. :)


@ danny:
if you add a linkage to your font in the IDE (e.g. &quot;AssetFont&quot;) you do can register that font in your application without having to define an extra Main.as for your lib FLA.
After having loaded the lib into your application as suggested in the above code use the getDefinition() approach to get your fonts definition via the font&#039;s linkage you applied in the IDE:

Example (font&#039;s linkage is &quot;AssetFont&quot;):

// dchangs loader code goes here ...

private function completeHandler(event:Event):void {
    var tSender : LoaderInfo = LoaderInfo(event.target);
    var AssetFont : Class = tSender.applicationDomain.getDefinition(&quot;AssetFont&quot;) as Class;
    Font.registerFont(AssetFont);
    
    // use font from here on...
}</description>
		<content:encoded><![CDATA[<p>@ dchang:<br />
Very nice topic and helpful solutions, thanks!<br />
Now, I&#8217;ve been working on the problem myself for a while because I was used to creating shared font libs in the IDE.<br />
However, when creating a font lib using the Flex SDK as you suggest, would it not be easier to directly register the fonts in the constructor of the FontLibrary?</p>
<p>That way you wouldn&#8217;t need to care about getting definitions and fishing for included font classes you might not even know the class names of (maybe someone else created the font class and didn&#8217;t document it properly <img src='http://nochump.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). Moreover, your application wouldn&#8217;t even need to know a thing about the fonts if the style definitions were included in an external style sheet that was loaded and applied as well.<br />
VoilÃ , no more font mess in the application: you load the lib, you load the style sheet and you create textfields and apply styles without knowing anything about fonts. <img src='http://nochump.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>@ danny:<br />
if you add a linkage to your font in the IDE (e.g. &#8220;AssetFont&#8221;) you do can register that font in your application without having to define an extra Main.as for your lib FLA.<br />
After having loaded the lib into your application as suggested in the above code use the getDefinition() approach to get your fonts definition via the font&#8217;s linkage you applied in the IDE:</p>
<p>Example (font&#8217;s linkage is &#8220;AssetFont&#8221;):</p>
<p>// dchangs loader code goes here &#8230;</p>
<p>private function completeHandler(event:Event):void {<br />
    var tSender : LoaderInfo = LoaderInfo(event.target);<br />
    var AssetFont : Class = tSender.applicationDomain.getDefinition(&#8220;AssetFont&#8221;) as Class;<br />
    Font.registerFont(AssetFont);</p>
<p>    // use font from here on&#8230;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bogdan Petrea</title>
		<link>http://nochump.com/blog/archives/20/comment-page-1#comment-11856</link>
		<dc:creator>Bogdan Petrea</dc:creator>
		<pubDate>Thu, 13 Dec 2007 16:09:55 +0000</pubDate>
		<guid isPermaLink="false">http://nochump.com/blog/?p=20#comment-11856</guid>
		<description>Hello all, especially Chris.
You wanted to dynamically embed fonts into your application.
My idea for you would be to use the FLEX module for apache or IIS to dynamically create swfs and generate the mxml files via a php script that writes to disk the mxml for each font. 
Hope this will work for you,
Cheers.</description>
		<content:encoded><![CDATA[<p>Hello all, especially Chris.<br />
You wanted to dynamically embed fonts into your application.<br />
My idea for you would be to use the FLEX module for apache or IIS to dynamically create swfs and generate the mxml files via a php script that writes to disk the mxml for each font.<br />
Hope this will work for you,<br />
Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: danny m</title>
		<link>http://nochump.com/blog/archives/20/comment-page-1#comment-10015</link>
		<dc:creator>danny m</dc:creator>
		<pubDate>Tue, 13 Nov 2007 16:31:42 +0000</pubDate>
		<guid isPermaLink="false">http://nochump.com/blog/?p=20#comment-10015</guid>
		<description>Sascha
I&#039;ve been coming across a similar issue, though I&#039;m skinning a completely different cat.  I&#039;m building an AS3 project that loads font libraries for different languages - works just fine to compile the font libraries in the Flash IDE if you need all the characters in a font, but not so if you don&#039;t (say an Asian language).  So, I built a middleware AS3 only project to embed the fonts I&#039;ve embedded in Flash and the wrap them in a class.  They need to be in a class, so I can use Font.registerFonts().  For some reason, when I load my externalFont.swf, registerFonts can&#039;t find the classes - I get a &quot;ReferenceError: Error #1065: Variable x is not defined.&quot;  Long story short, if I call Font.registerFont in the externalFont.swf main class, everything works fine. I never have to re-register my fonts in the main.swf.  Not sure if this will help, or maybe adds another piece to a growing puzzle.</description>
		<content:encoded><![CDATA[<p>Sascha<br />
I&#8217;ve been coming across a similar issue, though I&#8217;m skinning a completely different cat.  I&#8217;m building an AS3 project that loads font libraries for different languages &#8211; works just fine to compile the font libraries in the Flash IDE if you need all the characters in a font, but not so if you don&#8217;t (say an Asian language).  So, I built a middleware AS3 only project to embed the fonts I&#8217;ve embedded in Flash and the wrap them in a class.  They need to be in a class, so I can use Font.registerFonts().  For some reason, when I load my externalFont.swf, registerFonts can&#8217;t find the classes &#8211; I get a &#8220;ReferenceError: Error #1065: Variable x is not defined.&#8221;  Long story short, if I call Font.registerFont in the externalFont.swf main class, everything works fine. I never have to re-register my fonts in the main.swf.  Not sure if this will help, or maybe adds another piece to a growing puzzle.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Unformatt.com &#187; Blog Archive &#187; AS3: Using embedded fonts with components in Flash CS3</title>
		<link>http://nochump.com/blog/archives/20/comment-page-1#comment-9961</link>
		<dc:creator>Unformatt.com &#187; Blog Archive &#187; AS3: Using embedded fonts with components in Flash CS3</dc:creator>
		<pubDate>Tue, 13 Nov 2007 04:55:39 +0000</pubDate>
		<guid isPermaLink="false">http://nochump.com/blog/?p=20#comment-9961</guid>
		<description>[...] are a lot of real slick examples out there that use the Embed metadata to embed the font directly from the font file. This [...]</description>
		<content:encoded><![CDATA[<p>[...] are a lot of real slick examples out there that use the Embed metadata to embed the font directly from the font file. This [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sascha/hdrs</title>
		<link>http://nochump.com/blog/archives/20/comment-page-1#comment-8955</link>
		<dc:creator>sascha/hdrs</dc:creator>
		<pubDate>Sun, 04 Nov 2007 07:42:08 +0000</pubDate>
		<guid isPermaLink="false">http://nochump.com/blog/?p=20#comment-8955</guid>
		<description>Folks, how do you embed OTF fonts correctly by using an SWF file for the Flex compiler?

I need to embed some OTF fonts into a Flash AS3 project that is compiled with the Flex2 compiler. The thing is: it will not work.

I prepare a SWF in which I embed the fonts by putting them on the stage, check embed and set antialias for readability. Then I publish this SWF file.
Then in my AS3 class I try to embed the SWF with e.g....

[Embed(source=&#039;../assets/fonts.swf&#039;,
 fontName=&#039;Frutiger&#039;)] 
private static var FontClass:Class;

The fonts are obviously embedded because the SWF is about 20kb larger but the TextFields don&#039;t show any text. I have to use a StyleSheet object there and of course I have embed = true.

Anyone know how to do this correctly?</description>
		<content:encoded><![CDATA[<p>Folks, how do you embed OTF fonts correctly by using an SWF file for the Flex compiler?</p>
<p>I need to embed some OTF fonts into a Flash AS3 project that is compiled with the Flex2 compiler. The thing is: it will not work.</p>
<p>I prepare a SWF in which I embed the fonts by putting them on the stage, check embed and set antialias for readability. Then I publish this SWF file.<br />
Then in my AS3 class I try to embed the SWF with e.g&#8230;.</p>
<p>[Embed(source='../assets/fonts.swf',<br />
 fontName='Frutiger')]<br />
private static var FontClass:Class;</p>
<p>The fonts are obviously embedded because the SWF is about 20kb larger but the TextFields don&#8217;t show any text. I have to use a StyleSheet object there and of course I have embed = true.</p>
<p>Anyone know how to do this correctly?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ain Tohvri</title>
		<link>http://nochump.com/blog/archives/20/comment-page-1#comment-6912</link>
		<dc:creator>Ain Tohvri</dc:creator>
		<pubDate>Sat, 13 Oct 2007 07:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://nochump.com/blog/?p=20#comment-6912</guid>
		<description>For those of you using Flash IDE: font embedding in Flash CS3 doesn&#039;t support special characters that are out of Latin 1 range (unicode). For further information please read &lt;a href=&quot;http://tekkie.flashbit.net/flash/embedding-fonts-in-flash-cs3&quot; title=&quot;Embedding fonts in Flash CS3&quot; rel=&quot;nofollow&quot;&gt;an article at flash tekkie&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>For those of you using Flash IDE: font embedding in Flash CS3 doesn&#8217;t support special characters that are out of Latin 1 range (unicode). For further information please read <a href="http://tekkie.flashbit.net/flash/embedding-fonts-in-flash-cs3" title="Embedding fonts in Flash CS3" rel="nofollow">an article at flash tekkie</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://nochump.com/blog/archives/20/comment-page-1#comment-6647</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Tue, 09 Oct 2007 22:59:26 +0000</pubDate>
		<guid isPermaLink="false">http://nochump.com/blog/?p=20#comment-6647</guid>
		<description>Hello Mr Dchang 
long time lol

anyway ... i am loading fonts into an as3 file using the following
 
(Create a swf representing the font &quot;_Arial.swf&quot;) 

----------------code snip----------------------
[Embed(source=&#039;C:/WINDOWS/Fonts/arial.TTF&#039;,fontFamily=&quot;Arial&quot;)]
  public static var _Arial:Class;
...
Font.registerFont(_Arial); 
---------------------code snip----------------


(then i load the font.swf into another swf when it is needed.)
--------------------
 var loader:Loader = new Loader();               loader.contentLoaderInfo.addEventListener(Event.INIT,fontLoaded);
loader.load(new URLRequest(&quot;_Arial.swf&quot;));
---------------

i donot want to have to go through my system creating 100 swf files for fonts, + i want to be able to offer my users the ability to upload their own true type fonts.

i want to be able to dynamicaly embed the fonts with a variable path and variable name . 

is it even possible to pass a var for the path / fontfamily of the embed syntax ?  

example:

 [Embed(source=&#039;{src}&#039;,fontFamily=&quot;{font}&quot;)]
 var _font:Class;
Font.registerFont(_font);

let me know your thoughts.... thanks</description>
		<content:encoded><![CDATA[<p>Hello Mr Dchang<br />
long time lol</p>
<p>anyway &#8230; i am loading fonts into an as3 file using the following</p>
<p>(Create a swf representing the font &#8220;_Arial.swf&#8221;) </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;-code snip&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
[Embed(source='C:/WINDOWS/Fonts/arial.TTF',fontFamily="Arial")]<br />
  public static var _Arial:Class;<br />
&#8230;<br />
Font.registerFont(_Arial);<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;code snip&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>(then i load the font.swf into another swf when it is needed.)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
 var loader:Loader = new Loader();               loader.contentLoaderInfo.addEventListener(Event.INIT,fontLoaded);<br />
loader.load(new URLRequest(&#8220;_Arial.swf&#8221;));<br />
&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>i donot want to have to go through my system creating 100 swf files for fonts, + i want to be able to offer my users the ability to upload their own true type fonts.</p>
<p>i want to be able to dynamicaly embed the fonts with a variable path and variable name . </p>
<p>is it even possible to pass a var for the path / fontfamily of the embed syntax ?  </p>
<p>example:</p>
<p> [Embed(source='{src}',fontFamily="{font}")]<br />
 var _font:Class;<br />
Font.registerFont(_font);</p>
<p>let me know your thoughts&#8230;. thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ars Thanea Blog &#187; Blog Archive &#187; Shared fonts in Flash</title>
		<link>http://nochump.com/blog/archives/20/comment-page-1#comment-3443</link>
		<dc:creator>Ars Thanea Blog &#187; Blog Archive &#187; Shared fonts in Flash</dc:creator>
		<pubDate>Fri, 24 Aug 2007 14:19:50 +0000</pubDate>
		<guid isPermaLink="false">http://nochump.com/blog/?p=20#comment-3443</guid>
		<description>[...] Our friend sent me a link to a nice article about loading fonts into the SWF file. It&#8217;s quite useful feature if you often use multiple SWF files in your sites or applications. Check it out. [...]</description>
		<content:encoded><![CDATA[<p>[...] Our friend sent me a link to a nice article about loading fonts into the SWF file. It&#8217;s quite useful feature if you often use multiple SWF files in your sites or applications. Check it out. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
