<?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>Turtlebite&#039;s Blog &#187; embed fonts</title>
	<atom:link href="http://blog.turtlebite.com/tag/embed-fonts/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.turtlebite.com</link>
	<description>Flash CMS Framework, Fleb Framework, Global Navigation and other ActionScript Stuff</description>
	<lastBuildDate>Thu, 17 Nov 2011 06:01:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Fleb 2.0: the Flash Website Framework has grown up!</title>
		<link>http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/</link>
		<comments>http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 15:22:10 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Fleb Framework]]></category>
		<category><![CDATA[as3 cms]]></category>
		<category><![CDATA[as3 runtime dynamic font loading]]></category>
		<category><![CDATA[embed fonts]]></category>
		<category><![CDATA[flash navigation]]></category>
		<category><![CDATA[Flash SEO]]></category>
		<category><![CDATA[full flash website framework]]></category>
		<category><![CDATA[Global Navigation]]></category>
		<category><![CDATA[multipage printing as3]]></category>

		<guid isPermaLink="false">http://blog.turtlebite.com/?p=1107</guid>
		<description><![CDATA[Again some time has passed and while working on different projects I have continuosly improved the Fleb Framework. I have finally found the time to wrap it all up and release the next version. Besides a lot of small improvements to the global navigation (which is part of the Fleb Framework), I have integrated a [...]]]></description>
			<content:encoded><![CDATA[<p>Again some time has passed and while working on different projects I have continuosly improved the Fleb Framework. I have finally found the time to wrap it all up and release the next version. Besides a lot of small improvements to the global navigation (which is part of the Fleb Framework), I have integrated a few things for your convenience. Okay, let&#8217;s start with the new features:<br />
<span style="color: #ffffff;">.</span></p>
<h3><strong>iPhone / iPod / iPad Detection</strong></h3>
<h3><a href="http://blog.turtlebite.com/wp-content/uploads/2010/12/flash-iphone-alternative-fleb-framework_2.jpg"><img class="alignnone size-full wp-image-1127" title="flash-iphone-alternative-fleb-framework_2" src="http://blog.turtlebite.com/wp-content/uploads/2010/12/flash-iphone-alternative-fleb-framework_2.jpg" alt="" width="595" height="430" /></a></h3>
<p><a href="http://blog.turtlebite.com/wp-content/uploads/2010/12/flash-iphone-alternative-fleb-framework_2.jpg"></a>Flash on the iPhone? Unfortunatly not (not yet&#8230; I&#8217;m an optimist <img src='http://blog.turtlebite.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). But anyway, I believe it&#8217;s the wrong way to have the exact same site on a mobile device and in the browser. Not only is the screen smaller and loading takes longer, I personally have other priorities when surfing on a mobile phone. So let&#8217;s take this as a challenge and provide different content when someone visits your page on an iPhone. All I did is provide a detection in index.php which redirects users of iPhone &amp; Co. to a special page: iphone.php. In this file the same xml structure is parsed, but this time the navigation is displayed in a flat hierarchy to provide as much room as possible for the content itself. <a href="http://www.turtlebite.com/flebsite_demo_v2/iphone.php">Check it out!</a> I have used some iPhone specific settings so that the zooming is disabled for example:</p>
<pre>&lt;meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"&gt;</pre>
<p>You only need to adjust the CSS files to your needs.</p>
<p>Here 2 links with useful and detailed infos:<br />
<a href="http://www.engageinteractive.co.uk/blog/2008/06/19/tutorial-building-a-website-for-the-iphone/">http://www.engageinteractive.co.uk/blog/2008/06/19/tutorial-building-a-website-for-the-iphone/<br />
</a><a href="http://fuint.com/2010/09/when-developing-websites-you-have-to-care-about-different-browsers-as-well-as-mobile-devices-such-as-iphones-or-ipods-in-this-article-lets-have-a-look-at-the-10-most-useful-code-snippets-javas/">http://fuint.com/2010/09/when-developing-websites-you-have-to-..</a>.<br />
<span style="color: #ffffff;">.</span></p>
<h3><strong>Automatic width and height handling with full browser scrolling<br />
<span style="font-weight: normal;"><a href="http://blog.turtlebite.com/wp-content/uploads/2010/12/fleb-flash-framework-scrollbars.jpg"><img class="alignnone size-full wp-image-1110" title="fleb-flash-framework-scrollbars" src="http://blog.turtlebite.com/wp-content/uploads/2010/12/fleb-flash-framework-scrollbars.jpg" alt="" width="595" height="303" /></a></span></strong></h3>
<p><strong><span style="font-weight: normal;"><a href="http://blog.turtlebite.com/wp-content/uploads/2010/12/fleb-flash-framework-scrollbars.jpg"></a>I&#8217;ve decided to implement this into the Fleb Framework, because I use it in every website to be sure the user can see all content, even if he/she has a small display. I prefer to use the built in UI Scrollbars, because that way I get the most flexibility.<br />
</span></strong><strong><span style="font-weight: normal;">A few times I used other solutions that make use of the native browser scrollbars, but I was not happy with that, because there is no way to scroll just a part of the website: it always scrolls the whole embedded SWF. Check out <a href="http://www.turtlebite.com/flebsite_demo_v2/de/dienstleistungen/">this deeplink</a> of the Flebsite demo and scroll. Watch the word &#8220;BASE&#8221; at the upper left corner and also the black gradient at the top. It stays where it is, exactly what is wanted. This would not be possible if the browser scrollbars were used. Or <a href="http://www.findanddine.ch/lokalsuche/spaghetti">another example</a> to make it more clear: only the content is scrolled, the header and footer don&#8217;t move. <img src='http://blog.turtlebite.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  By the way: of course you can set if and how much the scrolling will ease in and out.</span></strong></p>
<p><strong><span style="font-weight: normal;">But if you prefer it the other way (<a href="http://swffit.millermedeiros.com/">SWFFit </a>for example): simply remove a few lines of code to get rid of the SiteScrollbars class and use your preferred solution.<br />
<span style="color: #ffffff;">.</span> </span></strong></p>
<h3><strong>Font Manager<br />
</strong><img class="alignnone size-full wp-image-1119" title="fleb-flash-framework-embedded-font-manager" src="http://blog.turtlebite.com/wp-content/uploads/2010/12/fleb-flash-framework-embedded-font-manager.jpg" alt="" width="595" height="236" /></h3>
<p>Another nice thing is now part of the Fleb framework: dynamic font loading. This is a really cool method I&#8217;ve found some time ago. <a href="http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/">Here is a post about it</a>. It&#8217;s ridiculously simple: Just create an empty FLA file, add one or more dynamic textfields to the stage and select the fonts, compile, done. All you have to do in Fleb later is telling the framework where the fonts are:</p>
<pre>Core.getInstance().init(this, pH, nH, "fonts/fonts.swf", "fonts/style.css");</pre>
<p>You can also load the styles at the same time. The font manager will be accessible from anywhere like this:</p>
<pre class="brush: php;">
import net.kaegi.utils.VarCentral;
var varcentral:Object = VarCentral.getInstance().vars;
tf.styleSheet = varcentral.flebFontManager.getStyleSheet();
tf.text = &quot;&lt;span class='font2'&gt;&quot; + txt + &quot;&lt;/span&gt;&quot;;
</pre>
<p><span style="color: #ffffff;">.</span></p>
<h3>Print Manager: multipage printing out of the box</h3>
<p><a href="http://blog.turtlebite.com/wp-content/uploads/2010/12/flash-multipage-print-as3-fleb-framework.jpg"><img class="alignnone size-full wp-image-1150" title="flash-multipage-print-as3-fleb-framework" src="http://blog.turtlebite.com/wp-content/uploads/2010/12/flash-multipage-print-as3-fleb-framework.jpg" alt="" width="595" height="500" /><br />
</a>In the <a href="http://www.turtlebite.com/flebsite_demo_v2/">flebsite demo</a>, I have integrated the printing solution to show how you can use it in a Fleb site if needed. It is a very handy method to provide the possibility to print out your website or parts of it. The Print class will adjust the size, accordingly to the choosen paper orientation, to always fit the content to the page (or pages, if multipage printing is desired). This class is simply imported in your Fleb main document class. It&#8217;s there for your convenience: if you don&#8217;t need it, just remove the import and the printing methods. To get more info about this class visit <a href="http://blog.turtlebite.com/multipage-printing-class-for-as3/">this post</a> and <a href="http://www.turtlebite.com/docs/print-home">the documentation</a>.</p>
<p><span style="color: #ffffff;">.</span></p>
<h3>And now?</h3>
<p>You will find all of this in the <a href="http://www.turtlebite.com/flebsite_demo_v2/">demo site</a>. You can download all files and analyze them. To get started and download the framework, <a href="http://www.turtlebite.com/docs/fleb-framework-home">please visit the documentation</a>.</p>
<p>Cheers (and merry christmas if this was my last post in this year&#8230;)<br />
Christian</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/&amp;title=Fleb+2.0%3A+the+Flash+Website+Framework+has+grown+up%21" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/&amp;title=Fleb+2.0%3A+the+Flash+Website+Framework+has+grown+up%21" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/&amp;title=Fleb+2.0%3A+the+Flash+Website+Framework+has+grown+up%21&amp;desc=Again%20some%20time%20has%20passed%20and%20while%20working%20on%20different%20projects%20I%20have%20continuosly%20improved%20the%20Fleb%20Framework.%20I%20have%20finally%20found%20the%20time%20to%20wrap%20it%20all%20up%20and%20release%20the%20next%20version.%20Besides%20a%20lot%20of%20small%20improvements%20to%20the%20global%20navigation%20%28which%20is%20part%20of%20the%20Fleb%20Framework%29%2C%20I%20have%20" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/&amp;bm_description=Fleb+2.0%3A+the+Flash+Website+Framework+has+grown+up%21&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/&amp;title=Fleb+2.0%3A+the+Flash+Website+Framework+has+grown+up%21" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/&amp;title=Fleb+2.0%3A+the+Flash+Website+Framework+has+grown+up%21" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/&amp;title=Fleb+2.0%3A+the+Flash+Website+Framework+has+grown+up%21" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Fleb+2.0%3A+the+Flash+Website+Framework+has+grown+up%21+-+http://b2l.me/a9tczj&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://blog.turtlebite.com/fleb-2-0-the-flash-website-framework-has-grown-up/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>Runtime dynamic font loading in AS3</title>
		<link>http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/</link>
		<comments>http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 08:04:44 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Utilities & Tips]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[as3 runtime dynamic font loading]]></category>
		<category><![CDATA[embed fonts]]></category>
		<category><![CDATA[runtime fonts]]></category>

		<guid isPermaLink="false">http://blog.flashcmsframework.com/?p=1031</guid>
		<description><![CDATA[I know this has been a long discussed topic. And I&#8217;m not going to re-invent the wheel. I have been searching for a long time now and have found many ways to dynamically load fonts at runtime in AS3, there are a lot of good solutions out there. But yesterday I found a font manager [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.turtlebite.com/wp-content/uploads/2010/08/as3_flash_runtime_dynamic_font_loading.jpg"></a><a href="http://blog.turtlebite.com/wp-content/uploads/2010/08/as3_flash_runtime_dynamic_font_loading1.jpg"></a><a href="http://blog.turtlebite.com/wp-content/uploads/2010/08/as3_flash_runtime_dynamic_font_loading2.jpg"><img class="alignleft size-full wp-image-1047" title="as3_flash_runtime_dynamic_font_loading" src="http://blog.turtlebite.com/wp-content/uploads/2010/08/as3_flash_runtime_dynamic_font_loading2.jpg" alt="" width="180" height="130" /></a></p>
<p>I know this has been a long discussed topic. And I&#8217;m not going to re-invent the wheel. I have been searching for a long time now and have found many ways to dynamically load fonts at runtime in AS3, there are a lot of good solutions out there. But yesterday I found a font manager class and WOW, that&#8217;s a really smart method. So all I did was wrapping it in another class, to make the handling even easier. <a href="http://www.turtlebite.com/downloads/dynamicfontloader.zip">Here it is.</a></p>
<p><a href="http://www.thetechlabs.com/tutorials/flash/dynamically-loading-fonts-with-fontloader-and-applying-styles-with-css-stylesheet-in-as3/">You should start with this tutorial</a> for the basic font loader manager class by <a href="http://etcs.ru/">etcs.ru</a> (<a href="http://translate.google.com/translate?hl=de&amp;sl=ru&amp;tl=en&amp;u=http://etcs.ru/blog/as3/fontloader_2/">translated</a>). Excerpt: &#8220;What the fontloader does is reading the swf bytecode and extract all fonts from it and registers it to the flash font class.&#8221;</p>
<p>What I did is creating a wrapper class for this, that makes the handling even easier and traces the CSS output file to the output window in the Flash IDE, so you can just copy it and paste in into a new style.css file.</p>
<p>Here is the code to load the fonts and listen to the events:</p>
<pre class="brush: php;">
import net.kaegi.utils.FontManager;
import net.kaegi.events.FontManagerEvent;
var fontManager:FontManager = new FontManager();
fontManager.addEventListener(FontManagerEvent.LOAD_PROGRESS, onFontManagerLoadProgress, false, 0, true);
fontManager.addEventListener(FontManagerEvent.LOAD_COMPLETE, onFontManagerLoadComplete, false, 0, true);
fontManager.addEventListener(FontManagerEvent.LOAD_ERROR, onFontManagerLoadError, false, 0, true);
fontManager.init(&quot;resources/fonts.swf&quot;, &quot;resources/style.css&quot;)

function onFontManagerLoadProgress(event:FontManagerEvent) {
	trace(&quot;FontManager LOAD Progress... &quot;+event.params.type+&quot;: &quot;+event.params.perc+&quot;% (&quot;+event.params.bytesLoaded +&quot;/&quot;+event.params.bytesTotal+&quot;)&quot;);
}
function onFontManagerLoadComplete(event:FontManagerEvent) {
	trace(&quot;FontManager LOAD Complete!&quot;);
	trace(event.params.displayFonts);
	trace(event.params.cssFileOutput);
}
function onFontManagerLoadError(event:FontManagerEvent) {
	trace(&quot;FontManager LOAD Error!&quot;);
	trace(event.params.msg);
}
</pre>
<p>Here is the output of the css trace, ready to use: You can copy and paste it into a new style.css file, then edit it to your needs.</p>
<pre class="brush: css;">
.font1 {
	font-family: &quot;Verdana&quot;;
	font-size: 12;
	color: #000000;
	/*font-weight: normal;*/
	/*font-style: normal;*/
	/*display: inline; /*inline, block, none
	/*leading: 0;
	/*letter-spacing: 0;
	/*margin-left: 0;
	/*margin-right: 0;*/
	/*text-align: left; /*left, center, right, justify*/
	/*text-decoration: none; /*none, underline*/
	/*text-indent: 0;*/
}

.font2 {
	font-family: &quot;Arial Unicode MS&quot;;
	font-size: 12;
	color: #000000;
	font-weight: bold;
	/*font-style: normal;*/
	/*display: inline; /*inline, block, none
	/*leading: 0;
	/*letter-spacing: 0;
	/*margin-left: 0;
	/*margin-right: 0;*/
	/*text-align: left; /*left, center, right, justify*/
	/*text-decoration: none; /*none, underline*/
	/*text-indent: 0;*/
}

.font3 {
	font-family: &quot;Helvetica CY BoldOblique&quot;;
	font-size: 12;
	color: #000000;
	font-weight: bold;
	font-style: italic;
	/*display: inline; /*inline, block, none
	/*leading: 0;
	/*letter-spacing: 0;
	/*margin-left: 0;
	/*margin-right: 0;*/
	/*text-align: left; /*left, center, right, justify*/
	/*text-decoration: none; /*none, underline*/
	/*text-indent: 0;*/
}
</pre>
<p><a href="http://www.turtlebite.com/downloads/dynamicfontloader.zip">Here are all the source files.</a></p>
<p>Some more useful links and resources about this topic:<br />
<a href="http://etcs.ru/pre/FontLoaderDemo/">http://etcs.ru/pre/FontLoaderDemo/</a><br />
<a href="http://www.thetechlabs.com/tutorials/flash/dynamically-loading-fonts-with-fontloader-and-applying-styles-with-css-stylesheet-in-as3/">http://www.thetechlabs.com/tutorials/flash/dynamically-loading-fonts-with-fontloader-and-applying-styles-with-css-stylesheet-in-as3/</a><br />
<a href="http://lab.revoke.ca/2010/02/as3-external-font-loading-class/">http://lab.revoke.ca/2010/02/as3-external-font-loading-class/</a><br />
<a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/StyleSheet.html">http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/StyleSheet.html</a></p>
<p>Even though I don&#8217;t need it in the font loading method described here, while searching the web I found a nice site to get unicode ranges: <a href="http://www.tillschneidereit.de/unicode_range_tool.html">http://www.tillschneidereit.de/unicode_range_tool.html</a> If you are embedding your founds using the EMBED tag you might find it useful.</p>
<p>OK, now back to daily business!</p>
<p>Cheers,<br />
Christian</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/&amp;title=Runtime+dynamic+font+loading+in+AS3" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/&amp;title=Runtime+dynamic+font+loading+in+AS3" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/&amp;title=Runtime+dynamic+font+loading+in+AS3&amp;desc=%0D%0A%0D%0AI%20know%20this%20has%20been%20a%20long%20discussed%20topic.%20And%20I%27m%20not%20going%20to%20re-invent%20the%20wheel.%20I%20have%20been%20searching%20for%20a%20long%20time%20now%20and%20have%20found%20many%20ways%20to%20dynamically%20load%20fonts%20at%20runtime%20in%20AS3%2C%20there%20are%20a%20lot%20of%20good%20solutions%20out%20there.%20But%20yesterday%20I%20found%20a%20font%20manager%20class%20and%20WOW%2C%20" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/&amp;bm_description=Runtime+dynamic+font+loading+in+AS3&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/&amp;title=Runtime+dynamic+font+loading+in+AS3" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/&amp;title=Runtime+dynamic+font+loading+in+AS3" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/&amp;title=Runtime+dynamic+font+loading+in+AS3" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Runtime+dynamic+font+loading+in+AS3+-+http://b2l.me/afqzjq&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://blog.turtlebite.com/runtime-dynamic-font-loading-in-as3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to use your own fonts and textstyles in the Flash CMS</title>
		<link>http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/</link>
		<comments>http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 19:16:22 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[Flash CMS]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[embed fonts]]></category>
		<category><![CDATA[textstyles]]></category>

		<guid isPermaLink="false">http://www.flashcmsframework.com/?p=481</guid>
		<description><![CDATA[This first tutorial will cover a very basic requirement of the Flash CMS: defining different fonts and font styles. I assume you have downloaded and installed the Flash CMS and everything works fine so far. You&#8217;ve tested and played around with it and now want to take the next steps. Step 1: Embedding the fonts [...]]]></description>
			<content:encoded><![CDATA[<p>This first tutorial will cover a very basic requirement of the Flash CMS: defining different fonts and font styles.</p>
<p><img class="alignnone size-full wp-image-493" title="ownfonts" src="http://www.flashcmsframework.com/wp-content/uploads/ownfonts.jpg" alt="ownfonts" width="673" height="397" /></p>
<p><span id="more-481"></span></p>
<p>I assume you have <a href="http://www.flashcmsframework.com/docs/doku.php?id=flash_cms_installation">downloaded and installed</a> the Flash CMS and everything works fine so far. You&#8217;ve tested and played around with it and now want to take the next steps.</p>
<p><strong>Step 1: Embedding the fonts</strong></p>
<ol>
<li>Open &#8220;fonts.fla&#8221; in Flash.</li>
<li>Open the library: you see 2 fonts already defined: &#8220;_myfont1&#8243; and &#8220;_myfont2&#8243;. You are going to owerwrite these 2 and create a third, new font.</li>
<li>In the library, create a new font. Name it &#8220;_myfont3&#8243;. (Note: The CMS will refer to these names. You can define up to 15 different fonts: &#8220;_myfont1&#8243; to &#8220;_myfont15&#8243;).</li>
<li>Open &#8220;_myfont1&#8243; in the library and choose any font you like. Be sure your export settings are the same as in the screenshot. Repeat these steps for &#8220;_myfont2&#8243; and &#8220;_myfont3&#8243; with different fonts.</li>
</ol>
<p><strong><img class="alignnone size-full wp-image-483" title="font_export" src="http://www.flashcmsframework.com/wp-content/uploads/font_export.jpg" alt="font_export" width="560" height="490" /></strong></p>
<p><strong>Step 2: Defining textstyles</strong></p>
<ol>
<li> Now open frame 1 (&#8220;setup&#8221;) in the actions panel to edit it.</li>
<li>At the top you can see the styles for hyperlinks. Change it if you like (different colours and decorations).</li>
<li>Next, you can find an array &#8220;_level0.testFontStyle&#8221;. Leave the name for now. There are 3 styles defined: &#8220;Body&#8221;, &#8220;Body bold&#8221; and &#8220;Headline&#8221;. These are the names the user sees and can choose from in the CMS.</li>
</ol>
<p>Now, type in the fontnames you have embedded. I have used these fonts: &#8220;Bumblebee&#8221; (_myfont1), &#8220;JanicesHand&#8221; (_myfont2) and &#8220;Gadget&#8221; (_myfont3). <strong> </strong></p>
<p>Here the code after all changes:</p>
<pre class="brush: php;">
_level0.testLinkStyle = new TextField.StyleSheet();
_level0.testLinkStyle.setStyle("a:link",{color:"#24A831", textDecoration:"underline"});
_level0.testLinkStyle.setStyle("a:hover",{color:"#177120", textDecoration:"none"});
// --------------------------------------------
_level0.testFontStyle = [];
// --------------------------------------------
f = {};
f.styleName = "Body";
f.font = "_myfont3";
f.size = 12;
f.color = 0x000000;
_level0.testFontStyle.push(f);
// --------------------------------------------
f = {};
f.styleName = "Handwriting in red";
f.font = "_myfont2";
f.size = 15;
f.color = 0x990000;
_level0.testFontStyle.push(f);
// --------------------------------------------
f = {};
f.styleName = "bigger Handwr. in blue";
f.font = "_myfont2";
f.size = 20;
f.color = 0x003399;
_level0.testFontStyle.push(f);
// --------------------------------------------
f = {};
f.styleName = "HUGE Handwr.in pink";
f.font = "_myfont2";
f.size = 45;
f.color = 0xD906F0;
_level0.testFontStyle.push(f);
// --------------------------------------------
f = {};
f.styleName = "The bubble Bumblebees";
f.font = "_myfont1";
f.size = 22;
f.color = 0x003333;
_level0.testFontStyle.push(f);
</pre>
<p><strong>Step 3: Export fonts.swf and upload it to the server</strong></p>
<ol>
<li>Export fonts.swf for (ActionScript 2!) and upload it into the folder &#8220;login&#8221; on your server.</li>
</ol>
<p>Login the CMS and test it. It should look similar to this (of course with your chosen fonts).</p>
<p><img class="alignnone size-full wp-image-491" title="texteditor" src="http://www.flashcmsframework.com/wp-content/uploads/texteditor.jpg" alt="texteditor" width="536" height="308" /><br />
<strong>Step 4: Create the FLA that loads this content</strong></p>
<p>First, we will create the &#8220;fonts_as3.swf&#8221;. In this SWF the fonts are embedded for global use all over your website. Create 3 fonts in the library with the settings as shown in this screenshot below.</p>
<p><img class="alignnone size-full wp-image-506" title="fonts_as3" src="http://www.flashcmsframework.com/wp-content/uploads/fonts_as3.jpg" alt="fonts_as3" width="546" height="429" /></p>
<p><strong>Step 6: Register the fonts in AS3</strong></p>
<pre class="brush: php;">

Font.registerFont(_myfont1);
Font.registerFont(_myfont2);
Font.registerFont(_myfont3);

import net.kaegi.utils.VarCentral;
var fonts:Array = [];
fonts[0] = ["_myfont1","Bumblebee"];
fonts[1] = ["_myfont2","JanicesHand Regular"];
fonts[2] = ["_myfont3","Gadget"];
VarCentral.getInstance().vars.fontsForCMS = fonts;
</pre>
<p>In the code above you can see that I use a little class, &#8220;VarCentral&#8221;. This comes in very handy if you want to store any variables in a central place because you may need them somewhere else in your site. It&#8217;s up to you to also use this or do the handling of global vars in your preferred way. The array &#8220;fonts&#8221; will later be used to replace all occurences of &#8220;_myfontX&#8221; in the html textfields of the CMS with the corresponding real fonts. This method is very useful, because you are able to change fonts without disturbing the saved html text.</p>
<p><strong>Step 7: Create the SWF that loads the CMS slots</strong></p>
<p><a href="http://www.flashcmsframework.com/downloads/turtlebite_flash_cms_example_embed_fonts.zip">Please download this FLAs</a>. I have commented everything so it should be self-explanatory. It also contains the font_as3.fla. Note that you may have to adjust it to your own fonts.</p>
<p>Below just a reminder that the Flash CMS backend is written in AS2 and your website is written in AS3:</p>
<p><img class="alignnone size-full wp-image-509" title="fonts_as2_as3.001" src="http://www.flashcmsframework.com/wp-content/uploads/fonts_as2_as3.001.jpg" alt="fonts_as2_as3.001" width="536" height="242" /></p>
<p>.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/&amp;title=How+to+use+your+own+fonts+and+textstyles+in+the+Flash+CMS" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/&amp;title=How+to+use+your+own+fonts+and+textstyles+in+the+Flash+CMS" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/&amp;title=How+to+use+your+own+fonts+and+textstyles+in+the+Flash+CMS&amp;desc=This%20first%20tutorial%20will%20cover%20a%20very%20basic%20requirement%20of%20the%20Flash%20CMS%3A%20defining%20different%20fonts%20and%20font%20styles.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0AI%20assume%20you%20have%20downloaded%20and%20installed%20the%20Flash%20CMS%20and%20everything%20works%20fine%20so%20far.%20You%27ve%20tested%20and%20played%20around%20with%20it%20and%20now%20want%20to%20take%20the%20next%20steps.%0D%0A%0D%0ASt" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/&amp;bm_description=How+to+use+your+own+fonts+and+textstyles+in+the+Flash+CMS&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/&amp;title=How+to+use+your+own+fonts+and+textstyles+in+the+Flash+CMS" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/&amp;title=How+to+use+your+own+fonts+and+textstyles+in+the+Flash+CMS" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/&amp;title=How+to+use+your+own+fonts+and+textstyles+in+the+Flash+CMS" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+use+your+own+fonts+and+textstyles+in+the+Flash+CMS+-+http://b2l.me/afrdnn&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://blog.turtlebite.com/how-to-use-your-own-fonts-and-textstyles-in-the-flash-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

