<?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 Using ActionScript 3.0</title>
	<atom:link href="http://www.hesslerdesign.com/blog/flash/embedding-fonts-using-actionscript-3-0/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hesslerdesign.com/blog/flash/embedding-fonts-using-actionscript-3-0/</link>
	<description>Smart Developers = Smart Websites</description>
	<lastBuildDate>Thu, 22 Dec 2011 15:48:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Kristin Markell</title>
		<link>http://www.hesslerdesign.com/blog/flash/embedding-fonts-using-actionscript-3-0/comment-page-1/#comment-371</link>
		<dc:creator>Kristin Markell</dc:creator>
		<pubDate>Thu, 08 Oct 2009 15:24:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=137#comment-371</guid>
		<description>Along side your post, Anthony, if you are wanting to incorporate the embedded fonts along with dynamically created text, there&#039;s a few other things to tack on. Create empty dynamic text fields on the stage. I usually place mine to the side of the stage. Embed the characters you want applied to these fields (i.e. special characters that may not register). Also, if you want to use bold or bold italic, those text fields have to be created separately. This also goes for creating the fonts in the library. As stated above with your steps of creating the fonts in your library and naming the uniquely as stated, that name will be used within the style sheet, wrapped in quotes:

Example:
/* text attributes */
p { color: #333333; font-family: &quot;Gill Sans MT&quot;; font-size: 14; line-height: 16; display: block }

Here&#039;s a class I developed that I use to load style sheets and apply the text style to the newly created style sheet within another class.

package classes{

	import flash.text.StyleSheet;
	import flash.text.*;
	import flash.events.*;
	import flash.net.*;
	/*********************************************/
	/* class is responsible for loading the		 */
	/* course stylesheet that holds all text,	 */
	/* bullets, citations, copyright, fonts, and */
	/* any other textual related styling		 */
	/*********************************************/
	public class LoadStyleSheet extends EventDispatcher {

		/* variables needed to load the stylesheet */
		static public var styleSheetCSS:StyleSheet;
		private var cssLoader:URLLoader;
		private var cssRequest:URLRequest;

		/* constructor function */
		public function LoadStyleSheet() {
		}
		
		public function loadStyleSheetItem(styleSheetLocation:String):void {
			var cssLoader:URLLoader = new URLLoader();
			cssLoader.addEventListener( Event.COMPLETE, handleLoadComplete, false, 0, true );
			cssLoader.load(new URLRequest(styleSheetLocation));
		}
		public function handleLoadComplete(event:Event):void {
			event.target.removeEventListener( Event.COMPLETE, handleLoadComplete, false );
			if ( !styleSheetCSS )styleSheetCSS = new StyleSheet();
			styleSheetCSS.parseCSS(event.target.data);
			dispatchEvent(event);
		}
		public function grabStyleSheet():StyleSheet {
				return styleSheetCSS;
		}
		
		/*********************************************/
		/* this function can be reused at anytime to */
		/* apply the css to a textArea or textField  */
		/* be sure to call the grabStyleSheet first  */
		/* before applying as it needs to be passed  */
		/* from the class that its being called from */
		/*********************************************/
		public function setTextStyle(whatTextField_txt:TextField, styleSheetCSS:StyleSheet):void {
			/* set text propeties */
			whatTextField_txt.styleSheet = styleSheetCSS;
			whatTextField_txt.selectable = false;
			whatTextField_txt.autoSize = TextFieldAutoSize.LEFT;
			whatTextField_txt.condenseWhite = true;
			whatTextField_txt.multiline = true;
			whatTextField_txt.wordWrap = true;
			whatTextField_txt.embedFonts = true;
			whatTextField_txt.antiAliasType = &quot;advanced&quot;;
		}
	}
}</description>
		<content:encoded><![CDATA[<p>Along side your post, Anthony, if you are wanting to incorporate the embedded fonts along with dynamically created text, there&#8217;s a few other things to tack on. Create empty dynamic text fields on the stage. I usually place mine to the side of the stage. Embed the characters you want applied to these fields (i.e. special characters that may not register). Also, if you want to use bold or bold italic, those text fields have to be created separately. This also goes for creating the fonts in the library. As stated above with your steps of creating the fonts in your library and naming the uniquely as stated, that name will be used within the style sheet, wrapped in quotes:</p>
<p>Example:<br />
/* text attributes */<br />
p { color: #333333; font-family: &#8220;Gill Sans MT&#8221;; font-size: 14; line-height: 16; display: block }</p>
<p>Here&#8217;s a class I developed that I use to load style sheets and apply the text style to the newly created style sheet within another class.</p>
<p>package classes{</p>
<p>	import flash.text.StyleSheet;<br />
	import flash.text.*;<br />
	import flash.events.*;<br />
	import flash.net.*;<br />
	/*********************************************/<br />
	/* class is responsible for loading the		 */<br />
	/* course stylesheet that holds all text,	 */<br />
	/* bullets, citations, copyright, fonts, and */<br />
	/* any other textual related styling		 */<br />
	/*********************************************/<br />
	public class LoadStyleSheet extends EventDispatcher {</p>
<p>		/* variables needed to load the stylesheet */<br />
		static public var styleSheetCSS:StyleSheet;<br />
		private var cssLoader:URLLoader;<br />
		private var cssRequest:URLRequest;</p>
<p>		/* constructor function */<br />
		public function LoadStyleSheet() {<br />
		}</p>
<p>		public function loadStyleSheetItem(styleSheetLocation:String):void {<br />
			var cssLoader:URLLoader = new URLLoader();<br />
			cssLoader.addEventListener( Event.COMPLETE, handleLoadComplete, false, 0, true );<br />
			cssLoader.load(new URLRequest(styleSheetLocation));<br />
		}<br />
		public function handleLoadComplete(event:Event):void {<br />
			event.target.removeEventListener( Event.COMPLETE, handleLoadComplete, false );<br />
			if ( !styleSheetCSS )styleSheetCSS = new StyleSheet();<br />
			styleSheetCSS.parseCSS(event.target.data);<br />
			dispatchEvent(event);<br />
		}<br />
		public function grabStyleSheet():StyleSheet {<br />
				return styleSheetCSS;<br />
		}</p>
<p>		/*********************************************/<br />
		/* this function can be reused at anytime to */<br />
		/* apply the css to a textArea or textField  */<br />
		/* be sure to call the grabStyleSheet first  */<br />
		/* before applying as it needs to be passed  */<br />
		/* from the class that its being called from */<br />
		/*********************************************/<br />
		public function setTextStyle(whatTextField_txt:TextField, styleSheetCSS:StyleSheet):void {<br />
			/* set text propeties */<br />
			whatTextField_txt.styleSheet = styleSheetCSS;<br />
			whatTextField_txt.selectable = false;<br />
			whatTextField_txt.autoSize = TextFieldAutoSize.LEFT;<br />
			whatTextField_txt.condenseWhite = true;<br />
			whatTextField_txt.multiline = true;<br />
			whatTextField_txt.wordWrap = true;<br />
			whatTextField_txt.embedFonts = true;<br />
			whatTextField_txt.antiAliasType = &#8220;advanced&#8221;;<br />
		}<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

