<?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 Flex 4</title>
	<atom:link href="http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sat, 11 Feb 2012 11:51:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Gaelle</title>
		<link>http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/comment-page-1/#comment-8621</link>
		<dc:creator>Gaelle</dc:creator>
		<pubDate>Wed, 08 Dec 2010 15:08:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/#comment-8621</guid>
		<description>Thanks Peter for the answer, the problem is that I need to pass through the Flash in order to add some specific characters not handled by the default font :( 

Anyway, I tried ambedding teh font from the actionscript, and I still get the same error : &quot;transcoding parameter is not supported by flex2.compiler.media.FontTranscoder&quot; as I tried to import the dfont, even though I m with an sdk4 and even if I create a project appart... aaaaah :(</description>
		<content:encoded><![CDATA[<p>Thanks Peter for the answer, the problem is that I need to pass through the Flash in order to add some specific characters not handled by the default font :( </p>
<p>Anyway, I tried ambedding teh font from the actionscript, and I still get the same error : &#8220;transcoding parameter is not supported by flex2.compiler.media.FontTranscoder&#8221; as I tried to import the dfont, even though I m with an sdk4 and even if I create a project appart&#8230; aaaaah :(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/comment-page-1/#comment-8615</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Tue, 07 Dec 2010 17:34:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/#comment-8615</guid>
		<description>@Gaelle,

Check out the fontswf utility instead of compiling w/ Flash CS4 or CS5; &lt;a href=&quot;http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f5f.html#WS02f7d8d4857b16776fadeef71269f135e73-8000&quot; rel=&quot;nofollow&quot;&gt;&quot;Using the fontswf utility&quot;&lt;/a&gt;.

Peter</description>
		<content:encoded><![CDATA[<p>@Gaelle,</p>
<p>Check out the fontswf utility instead of compiling w/ Flash CS4 or CS5; <a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f5f.html#WS02f7d8d4857b16776fadeef71269f135e73-8000" rel="nofollow">&#8220;Using the fontswf utility&#8221;</a>.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gaelle</title>
		<link>http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/comment-page-1/#comment-8613</link>
		<dc:creator>Gaelle</dc:creator>
		<pubDate>Tue, 07 Dec 2010 14:41:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/#comment-8613</guid>
		<description>I have the same problem : 

warning: incompatible embedded font &#039;Lucida Grande&#039; specified for spark.components::RichText (myTargetText) . This component requires that the embedded font be declared with embedAsCff=true.

as I embbed a swf file in my css with the param embedAsCff set to true : 
[code]@font-face {
	src:				url(&quot;lucidaFont.swf&quot;);
	fontWeight: 		normal;
	font-family:		&quot;Lucida Grande&quot;;
	embed-as-cff:true;
	embedAsCff:true;
}

s&#124;RichText{
	font-size:12;
	rendering-mode:cff;
	font-lookup: embeddedCFF;
	font-family:&quot;Lucida Grande&quot;;
	font-weight:normal;
	color:#000000;
	text-align: start;
	direction: ltr;
}

[/code]

I think the problem comes from the swf embedded font cause when I use the &quot;Lucida Grande.dfont&quot; it is working fine... I tried compiling it in CS4, CS5 (with export in actionScript set to TLF), without success..
But I need to use the swf, so I have to find a way to embedded the font as cff in Flash. Stuck since 2 days on the problem ... Help !!! (Peter the master :D)</description>
		<content:encoded><![CDATA[<p>I have the same problem : </p>
<p>warning: incompatible embedded font &#8216;Lucida Grande&#8217; specified for spark.components::RichText (myTargetText) . This component requires that the embedded font be declared with embedAsCff=true.</p>
<p>as I embbed a swf file in my css with the param embedAsCff set to true :<br />
[code]@font-face {<br />
	src:				url("lucidaFont.swf");<br />
	fontWeight: 		normal;<br />
	font-family:		"Lucida Grande";<br />
	embed-as-cff:true;<br />
	embedAsCff:true;<br />
}</p>
<p>s|RichText{<br />
	font-size:12;<br />
	rendering-mode:cff;<br />
	font-lookup: embeddedCFF;<br />
	font-family:"Lucida Grande";<br />
	font-weight:normal;<br />
	color:#000000;<br />
	text-align: start;<br />
	direction: ltr;<br />
}</p>
<p>[/code]</p>
<p>I think the problem comes from the swf embedded font cause when I use the &#8220;Lucida Grande.dfont&#8221; it is working fine&#8230; I tried compiling it in CS4, CS5 (with export in actionScript set to TLF), without success..<br />
But I need to use the swf, so I have to find a way to embedded the font as cff in Flash. Stuck since 2 days on the problem &#8230; Help !!! (Peter the master :D)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: calvin</title>
		<link>http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/comment-page-1/#comment-7733</link>
		<dc:creator>calvin</dc:creator>
		<pubDate>Mon, 17 May 2010 23:20:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/#comment-7733</guid>
		<description>@ Annoyed :I agree it is rubbish that they have always made font embedding difficult for many years now and again this evening I struggle to get my font embeded in a component.
@everyone :This example is working in MAIN but not for other rich text instances throughout !</description>
		<content:encoded><![CDATA[<p>@ Annoyed :I agree it is rubbish that they have always made font embedding difficult for many years now and again this evening I struggle to get my font embeded in a component.<br />
@everyone :This example is working in MAIN but not for other rich text instances throughout !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: judah</title>
		<link>http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/comment-page-1/#comment-7693</link>
		<dc:creator>judah</dc:creator>
		<pubDate>Thu, 13 May 2010 07:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/#comment-7693</guid>
		<description>Here is a script to check if your font was embedded. You add a click handler to the Label/ RichText/ etc component. What made all the difference was adding the line fontLookup=&quot;embeddedCFF&quot; to the component. A lot of examples I either glazed over this property or they didn&#039;t require it in earlier builds. 

http://pastebin.com/3jmqifnK
&lt;pre lang=&quot;actionscript3&quot;&gt;
[Bindable]
public var details:String;
			
protected function getTextDetails(event:MouseEvent):void {

	// will return device, embedded or embeddedCFF
	var fontLookup:String = Object(event.currentTarget).textFlow.computedFormat.fontLookup; 
	var fontFamily:String = Object(event.currentTarget).textFlow.computedFormat.fontFamily;
	var renderingMode:String = Object(event.currentTarget).textFlow.computedFormat.renderingMode;
	var details:String = &quot;Font: &quot;+fontFamily+&quot;, Font Lookup: &quot;+fontLookup + &quot;, Rendering Mode: &quot;+renderingMode;
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Here is a script to check if your font was embedded. You add a click handler to the Label/ RichText/ etc component. What made all the difference was adding the line fontLookup=&#8221;embeddedCFF&#8221; to the component. A lot of examples I either glazed over this property or they didn&#8217;t require it in earlier builds. </p>
<p><a href="http://pastebin.com/3jmqifnK" rel="nofollow">http://pastebin.com/3jmqifnK</a></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span>
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> details<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> getTextDetails<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// will return device, embedded or embeddedCFF</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> fontLookup<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">Object</span><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">currentTarget</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>textFlow<span style="color: #000066; font-weight: bold;">.</span>computedFormat<span style="color: #000066; font-weight: bold;">.</span>fontLookup<span style="color: #000066; font-weight: bold;">;</span> 
	<span style="color: #6699cc; font-weight: bold;">var</span> fontFamily<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">Object</span><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">currentTarget</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>textFlow<span style="color: #000066; font-weight: bold;">.</span>computedFormat<span style="color: #000066; font-weight: bold;">.</span>fontFamily<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> renderingMode<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">Object</span><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">currentTarget</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>textFlow<span style="color: #000066; font-weight: bold;">.</span>computedFormat<span style="color: #000066; font-weight: bold;">.</span>renderingMode<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> details<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;Font: &quot;</span><span style="color: #000066; font-weight: bold;">+</span>fontFamily<span style="color: #000066; font-weight: bold;">+</span><span style="color: #990000;">&quot;, Font Lookup: &quot;</span><span style="color: #000066; font-weight: bold;">+</span>fontLookup <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot;, Rendering Mode: &quot;</span><span style="color: #000066; font-weight: bold;">+</span>renderingMode<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Annoyed</title>
		<link>http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/comment-page-1/#comment-6839</link>
		<dc:creator>Annoyed</dc:creator>
		<pubDate>Mon, 25 Jan 2010 06:56:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/#comment-6839</guid>
		<description>Congratulations to the Adobe Development team for continuing to make Font Embedding the most annoying and frustrating aspect of Flash/Flex development.  There has to be an easier and more intuitive way.</description>
		<content:encoded><![CDATA[<p>Congratulations to the Adobe Development team for continuing to make Font Embedding the most annoying and frustrating aspect of Flash/Flex development.  There has to be an easier and more intuitive way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pc.de free fonts</title>
		<link>http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/comment-page-1/#comment-6754</link>
		<dc:creator>pc.de free fonts</dc:creator>
		<pubDate>Mon, 11 Jan 2010 16:02:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/#comment-6754</guid>
		<description>I will try it in evening.Thanks for good example,well,nice share.</description>
		<content:encoded><![CDATA[<p>I will try it in evening.Thanks for good example,well,nice share.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/comment-page-1/#comment-6719</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Sun, 03 Jan 2010 20:32:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/#comment-6719</guid>
		<description>@Parmy,

Ah yes, if you&#039;re using the &lt;em&gt;ns.adobe.com/flex/halo&lt;/em&gt; namespace you&#039;re using an old Flex 4 beta SDK and your code will need to be changed when you upgrade to a newer nightly build of the Flex 4 SDK.
The new Spark TextArea is built upon TLF (Text Layout Framework) which is built upon FTE (Flash Text Engine), and includes better bi-directional text support, ligatures, subscript/superscript, strikethrough, and all around better looking text.

Yes, you can use the classic TextField, MX TextArea, or Spark TextArea without embedding a font. Also, all work with embedded fonts. All just depends on whether you want to rotate the text, or change the alpha, or if you want to ensure that the Flash/Flex application will work on a user&#039;s computer if they do not have the specific font installed on their machine.

Peter</description>
		<content:encoded><![CDATA[<p>@Parmy,</p>
<p>Ah yes, if you&#8217;re using the <em>ns.adobe.com/flex/halo</em> namespace you&#8217;re using an old Flex 4 beta SDK and your code will need to be changed when you upgrade to a newer nightly build of the Flex 4 SDK.<br />
The new Spark TextArea is built upon TLF (Text Layout Framework) which is built upon FTE (Flash Text Engine), and includes better bi-directional text support, ligatures, subscript/superscript, strikethrough, and all around better looking text.</p>
<p>Yes, you can use the classic TextField, MX TextArea, or Spark TextArea without embedding a font. Also, all work with embedded fonts. All just depends on whether you want to rotate the text, or change the alpha, or if you want to ensure that the Flash/Flex application will work on a user&#8217;s computer if they do not have the specific font installed on their machine.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Parmy</title>
		<link>http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/comment-page-1/#comment-6718</link>
		<dc:creator>Parmy</dc:creator>
		<pubDate>Sun, 03 Jan 2010 19:49:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/#comment-6718</guid>
		<description>Hi Peter

Thanks a lot for your response.

My apologies for my misleading post and my guesses at what the problem were; I&#039;ll be more careful in future :-)

I had to make one slight mod, to the code you listed to make it compile/work:

Line 4: 

xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot;

I changed to:

xmlns:mx=&quot;library://ns.adobe.com/flex/halo&quot;

If you could help me with the following questions, I&#039;d appreciate the help:

1 - What if any would be the advantage of using the new spark components (for instance TextArea) over the older TextField? From what I can see, the new FTE and TLF provide lower level support; however, more code effort is required. From a TextField, I&#039;m able to set background color/alpha/border etc... With TextArea I either have to use setStyle or TextAreaSkin etc... I do understand that there are a number of improvements for sparks* TextArea over mx* TextArea.

2 - In the example I provided, I was able to use the new sparks* TextArea without embedding a font. I guess the obvious reason for embedding a font is it ensures the final swf app has access to the required font?

Thanks again for your help and support.

Cheers</description>
		<content:encoded><![CDATA[<p>Hi Peter</p>
<p>Thanks a lot for your response.</p>
<p>My apologies for my misleading post and my guesses at what the problem were; I&#8217;ll be more careful in future :-)</p>
<p>I had to make one slight mod, to the code you listed to make it compile/work:</p>
<p>Line 4: </p>
<p>xmlns:mx=&#8221;library://ns.adobe.com/flex/mx&#8221;</p>
<p>I changed to:</p>
<p>xmlns:mx=&#8221;library://ns.adobe.com/flex/halo&#8221;</p>
<p>If you could help me with the following questions, I&#8217;d appreciate the help:</p>
<p>1 &#8211; What if any would be the advantage of using the new spark components (for instance TextArea) over the older TextField? From what I can see, the new FTE and TLF provide lower level support; however, more code effort is required. From a TextField, I&#8217;m able to set background color/alpha/border etc&#8230; With TextArea I either have to use setStyle or TextAreaSkin etc&#8230; I do understand that there are a number of improvements for sparks* TextArea over mx* TextArea.</p>
<p>2 &#8211; In the example I provided, I was able to use the new sparks* TextArea without embedding a font. I guess the obvious reason for embedding a font is it ensures the final swf app has access to the required font?</p>
<p>Thanks again for your help and support.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/comment-page-1/#comment-6708</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Wed, 30 Dec 2009 19:55:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/15/embedding-fonts-in-flex-gumbo/#comment-6708</guid>
		<description>@Parmy,

Sure, your revised example is better since it doesn&#039;t try and use &lt;code&gt;systemManager.stage.addChild()&lt;/code&gt;, but it doesn&#039;t really solve the problem of not being able to use an embedded font with a TextField. The one important thing to note is that there are two ways of font embedding now with Flex 4 and Flash Player 10. Previously you would embed a font and it would always use the flash.text.TextField class and use a DefineFont3 font behind the scenes. Now with the new Flash Text Engine/FTE (flash.text.engine.*) classes and Text Layout Framework/TLF (flashx.textLayout.*) classes, you can also embed fonts as DefineFont4 by setting the &lt;code&gt;embedAsCFF&lt;/code&gt; property to &lt;code&gt;true&lt;/code&gt; (which is now the default value in the latest beta Flex 4 SDK builds).
So the important thing to remember is that if you want to use embedded fonts, if you&#039;re using the &quot;older&quot; TextField based Flex components (mx.*) -- or are using the TextField class directly , you need to set the &lt;code&gt;embedAsCFF&lt;/code&gt; property to &lt;code&gt;false&lt;/code&gt; when embedding your fonts. If you are using the newer FTE or TLF based Flex components (spark.*), you need to set the &lt;code&gt;embedAsCFF&lt;/code&gt; property to &lt;code&gt;true&lt;/code&gt; when embedding your fonts.

Here&#039;s a slightly modified version of your first example which uses an embedded font with a classic flash.text.TextField object:
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;s:Application xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot;
               xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;
               xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot;
               initialize=&quot;init();&quot;&gt;
    
    &lt;fx:Script&gt;
        &lt;![CDATA[
            public var boxHolder:MovieClip;
            public var textHolder:MovieClip;
            public var textTitle:MovieClip;
            
            [Embed(source=&quot;C:/Windows/fonts/arial.ttf&quot;,
                    fontFamily=&quot;ArialEmbedded&quot;,
                    mimeType=&quot;application/x-font&quot;,
                    embedAsCFF=&quot;false&quot;)]
            private const ArialEmbeddedFont:Class;
            
            public function init():void {
                boxHolder = new MovieClip();
                boxHolder.graphics.beginFill(0x990000);
                boxHolder.graphics.drawRoundRect(50, 30, 100, 60, 10);
                uic.addChild(boxHolder);
                
                var myFont:Font = new ArialEmbeddedFont();
                
                var myFormat:TextFormat = new TextFormat();
                myFormat.font = myFont.fontName;
                myFormat.size = 12;
                myFormat.color = 0x000000; // black
                myFormat.align = TextFormatAlign.LEFT;
                
                var myTextField:TextField = new TextField();
                myTextField.width = 80;
                myTextField.wordWrap = true;
                myTextField.defaultTextFormat = myFormat;
                myTextField.embedFonts = true;
                myTextField.multiline = true;
                myTextField.htmlText = &quot;Hello World&quot;;
                myTextField.selectable = false;
                myTextField.background = false;
                myTextField.border = false;
                myTextField.antiAliasType = AntiAliasType.ADVANCED;
                myTextField.autoSize = TextFieldAutoSize.LEFT;
                
                textTitle = new MovieClip();
                textTitle.x = 40;
                textTitle.y = 20;
                textTitle.addChild(myTextField);
                
                textHolder = new MovieClip();
                textHolder.addChild(textTitle);
                uic.addChild(textHolder);
            }
        ]]&gt;
    &lt;/fx:Script&gt;
    
    &lt;mx:UIComponent id=&quot;uic&quot; /&gt;
    
&lt;/s:Application&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>@Parmy,</p>
<p>Sure, your revised example is better since it doesn&#8217;t try and use <code>systemManager.stage.addChild()</code>, but it doesn&#8217;t really solve the problem of not being able to use an embedded font with a TextField. The one important thing to note is that there are two ways of font embedding now with Flex 4 and Flash Player 10. Previously you would embed a font and it would always use the flash.text.TextField class and use a DefineFont3 font behind the scenes. Now with the new Flash Text Engine/FTE (flash.text.engine.*) classes and Text Layout Framework/TLF (flashx.textLayout.*) classes, you can also embed fonts as DefineFont4 by setting the <code>embedAsCFF</code> property to <code>true</code> (which is now the default value in the latest beta Flex 4 SDK builds).<br />
So the important thing to remember is that if you want to use embedded fonts, if you&#8217;re using the &#8220;older&#8221; TextField based Flex components (mx.*) &#8212; or are using the TextField class directly , you need to set the <code>embedAsCFF</code> property to <code>false</code> when embedding your fonts. If you are using the newer FTE or TLF based Flex components (spark.*), you need to set the <code>embedAsCFF</code> property to <code>true</code> when embedding your fonts.</p>
<p>Here&#8217;s a slightly modified version of your first example which uses an embedded font with a classic flash.text.TextField object:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">               xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">               xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span></span>
<span style="color: #000000;">               initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            public var boxHolder:MovieClip;</span>
<span style="color: #000000;">            public var textHolder:MovieClip;</span>
<span style="color: #000000;">            public var textTitle:MovieClip;</span>
&nbsp;
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">&quot;C:/Windows/fonts/arial.ttf&quot;</span>,</span>
<span style="color: #000000;">                    fontFamily=<span style="color: #ff0000;">&quot;ArialEmbedded&quot;</span>,</span>
<span style="color: #000000;">                    mimeType=<span style="color: #ff0000;">&quot;application/x-font&quot;</span>,</span>
<span style="color: #000000;">                    embedAsCFF=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            private const ArialEmbeddedFont:Class;</span>
&nbsp;
<span style="color: #000000;">            public function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                boxHolder = new MovieClip<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                boxHolder.graphics.beginFill<span style="color: #66cc66;">&#40;</span>0x990000<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                boxHolder.graphics.drawRoundRect<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span>, <span style="color: #cc66cc;">30</span>, <span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">60</span>, <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                uic.addChild<span style="color: #66cc66;">&#40;</span>boxHolder<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var myFont:Font = new ArialEmbeddedFont<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var myFormat:TextFormat = new TextFormat<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                myFormat.font = myFont.fontName;</span>
<span style="color: #000000;">                myFormat.size = <span style="color: #cc66cc;">12</span>;</span>
<span style="color: #000000;">                myFormat.color = 0x000000; // black</span>
<span style="color: #000000;">                myFormat.align = TextFormatAlign.LEFT;</span>
&nbsp;
<span style="color: #000000;">                var myTextField:TextField = new TextField<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                myTextField.width = <span style="color: #cc66cc;">80</span>;</span>
<span style="color: #000000;">                myTextField.wordWrap = true;</span>
<span style="color: #000000;">                myTextField.defaultTextFormat = myFormat;</span>
<span style="color: #000000;">                myTextField.embedFonts = true;</span>
<span style="color: #000000;">                myTextField.multiline = true;</span>
<span style="color: #000000;">                myTextField.htmlText = <span style="color: #ff0000;">&quot;Hello World&quot;</span>;</span>
<span style="color: #000000;">                myTextField.selectable = false;</span>
<span style="color: #000000;">                myTextField.background = false;</span>
<span style="color: #000000;">                myTextField.border = false;</span>
<span style="color: #000000;">                myTextField.antiAliasType = AntiAliasType.ADVANCED;</span>
<span style="color: #000000;">                myTextField.autoSize = TextFieldAutoSize.LEFT;</span>
&nbsp;
<span style="color: #000000;">                textTitle = new MovieClip<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                textTitle.x = <span style="color: #cc66cc;">40</span>;</span>
<span style="color: #000000;">                textTitle.y = <span style="color: #cc66cc;">20</span>;</span>
<span style="color: #000000;">                textTitle.addChild<span style="color: #66cc66;">&#40;</span>myTextField<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                textHolder = new MovieClip<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                textHolder.addChild<span style="color: #66cc66;">&#40;</span>textTitle<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                uic.addChild<span style="color: #66cc66;">&#40;</span>textHolder<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:UIComponent</span> id=<span style="color: #ff0000;">&quot;uic&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Peter</p>
]]></content:encoded>
	</item>
</channel>
</rss>

