<?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: Using a CFF embedded font with an MX Label control in Flex 4</title>
	<atom:link href="http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Sun, 12 Feb 2012 19:26:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Yannick Lacaute</title>
		<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/comment-page-1/#comment-7269</link>
		<dc:creator>Yannick Lacaute</dc:creator>
		<pubDate>Tue, 16 Mar 2010 20:38:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/#comment-7269</guid>
		<description>Hi,

I have found the real problem :  &lt;b&gt; -theme=${flexlib}/themes/Halo/halo.swc&lt;/b&gt;

When you add this line to the compiler, the fonts in the TLF aren&#039;t embedded anymore ! OFC, this is not the case in your sample... (with Spark components only). 

Yannick</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have found the real problem :  <b> -theme=${flexlib}/themes/Halo/halo.swc</b></p>
<p>When you add this line to the compiler, the fonts in the TLF aren&#8217;t embedded anymore ! OFC, this is not the case in your sample&#8230; (with Spark components only). </p>
<p>Yannick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/comment-page-1/#comment-7250</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Sat, 13 Mar 2010 06:18:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/#comment-7250</guid>
		<description>Hi again !

1) Sorry about my previous comment, I put my mxml code into &quot;code&quot; tag but it seems it didn&#039;t work...
2) Not without having really strange behaviours, I can now use &quot;mx:Application&quot; with the new namespaces by using a recent SDK4 build.
3) Your sample works :) But you use , I didn&#039;t... (in fact I &quot;couldn&#039;t&quot;). Since I can use Spark component like R.E.T, it will be The Deliverance !! (I hope)

The remaining problems are :
 - no code-hints and colors in files using new namespaces
 - html-template must be generated by hand for Flex Application (this is not really a problem)

I followed &lt;a href=&quot;http://opensource.adobe.com/wiki/display/flexsdk/Targeting+Flash+Player+10&quot; rel=&quot;nofollow&quot;&gt;the official Adobe tutorial to correct code-hints&lt;/a&gt; but I still have little problems, but not really important. (colors sometimes disappears, etc)

Thanks Peter for yours replies, it will normaly correct my problem of embedded font with TLF, I will try to use some Spark component from now :)


Yannick


ps: I&#039;am pretty sure there are some bugs during compilation when you create a Flex Project using SDK3 and then you change it to SDK4. Since I have started with a new workspace with the SDK4 directly set a default for creating new project, I didn&#039;t see any problems.</description>
		<content:encoded><![CDATA[<p>Hi again !</p>
<p>1) Sorry about my previous comment, I put my mxml code into &#8220;code&#8221; tag but it seems it didn&#8217;t work&#8230;<br />
2) Not without having really strange behaviours, I can now use &#8220;mx:Application&#8221; with the new namespaces by using a recent SDK4 build.<br />
3) Your sample works :) But you use , I didn&#8217;t&#8230; (in fact I &#8220;couldn&#8217;t&#8221;). Since I can use Spark component like R.E.T, it will be The Deliverance !! (I hope)</p>
<p>The remaining problems are :<br />
 &#8211; no code-hints and colors in files using new namespaces<br />
 &#8211; html-template must be generated by hand for Flex Application (this is not really a problem)</p>
<p>I followed <a href="http://opensource.adobe.com/wiki/display/flexsdk/Targeting+Flash+Player+10" rel="nofollow">the official Adobe tutorial to correct code-hints</a> but I still have little problems, but not really important. (colors sometimes disappears, etc)</p>
<p>Thanks Peter for yours replies, it will normaly correct my problem of embedded font with TLF, I will try to use some Spark component from now :)</p>
<p>Yannick</p>
<p>ps: I&#8217;am pretty sure there are some bugs during compilation when you create a Flex Project using SDK3 and then you change it to SDK4. Since I have started with a new workspace with the SDK4 directly set a default for creating new project, I didn&#8217;t see any problems.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/comment-page-1/#comment-7249</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Sat, 13 Mar 2010 02:40:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/#comment-7249</guid>
		<description>It looks like you&#039;re using an old version of the Flex 4 SDK. Please update to a newer nightly version of Flex 4+ from http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4 and try again.

Also, it may work better if you try downloading the Flash Builder 4 beta instead of using Flex Builder 3.

Peter</description>
		<content:encoded><![CDATA[<p>It looks like you&#8217;re using an old version of the Flex 4 SDK. Please update to a newer nightly version of Flex 4+ from <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4" rel="nofollow">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a> and try again.</p>
<p>Also, it may work better if you try downloading the Flash Builder 4 beta instead of using Flex Builder 3.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yannick Lacaute</title>
		<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/comment-page-1/#comment-7245</link>
		<dc:creator>Yannick Lacaute</dc:creator>
		<pubDate>Sat, 13 Mar 2010 01:51:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/#comment-7245</guid>
		<description>[COMMENT PART 1 (due to spam protection...)]
Hi Peter,

TY for answer. If I change your application into a Spark application (s:App) : it works nice, font is embedded, same result on Linux &amp; Vista. But, always with s:App, if I load the 

textFlow from a XML, it doesn&#039;t work.

Moreover, I can&#039;t compile your example as it, because of namespaces.

&lt;b&gt;Case 1 : compile, no runtime error, but embedded font not work if xml loaded&lt;/b&gt;
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;
&lt;mx:Script&gt; ... &lt;/mx:Script&gt;
&lt;/pre&gt;
 AS : with &quot;addChild&quot; function

&lt;b&gt;Case 2 : compile, no runtime error, but embedded font not work if xml loaded&lt;/b&gt;
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;s:Application
      xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot;
      xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot;
      xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;&gt;
&lt;fx:Script&gt; ... &lt;/fx:Script&gt;
&lt;/pre&gt;
 AS : with &quot;addElement&quot; function

&lt;b&gt;Case 3 : don&#039;t compile&lt;/b&gt;
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;mx:Application
      xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot;
      xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot;
      xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;&gt;
&lt;/pre&gt;
 Error : can&#039;t resolve mx:Application into a component


[COMMENT PART 2 (due to spam protection...)]
I googled many hours a few weeks ago and found nothing.
The fact is I can run samples applications with TLF, which is in SDK4, so I am sure to use SDK4.
 - I especialy take a look &lt;a href=&quot;http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;
 - different SDK4 build tested...
 - putting the globalplayers.swc of SDK4 in external in the Fx project...
I never understood why I could&#039;nt use mx:Application ! Maybe this is a part of the solution for embedded font in TLF (?)

&lt;b&gt;So now, my sample code&lt;/b&gt;

The XML loaded : 
&lt;pre lang=&quot;xml&quot;&gt;
&lt;TextFlow
	xmlns=&quot;http://ns.adobe.com/textLayout/2008&quot; whiteSpaceCollapse=&quot;collapse&quot; paddingTop=&quot;30&quot;
	renderingMode=&quot;cff&quot; fontFamily=&quot;TahomaCFF&quot; fontLookup=&quot;embeddedCFF&quot;&gt;
	&lt;p fontSize=&quot;16&quot; textAlign=&quot;center&quot;&gt;This must be Embedded Tahoma.
	&lt;span fontWeight=&quot;bold&quot;&gt;And this must be Tahoma bold&lt;/span&gt;&lt;/p&gt;
&lt;/TextFlow&gt;
&lt;/pre&gt;

[COMMENT PART 3 (due to spam protection...)]
The Application (I give the Spark App sample, even if I _must_ use an mx:Application)
=&gt; given in another comment because my comment is too long...

&lt;pre lang=&quot;css&quot;&gt;


 
    
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
 
        @font-face{
            src: url(&quot;C:/Windows/fonts/tahomabd.ttf&quot;);
            font-family: &quot;TahomaCFF&quot;;
            font-weight: bold;
            embedAsCFF: true;
        }
 
        @font-face{
            src: url(&quot;C:/Windows/fonts/tahoma.ttf&quot;);
            font-family: &quot;TahomaCFF&quot;;
            embedAsCFF: true;
        }
 
        global {
            font-family: &quot;TahomaCFF&quot;;
            font-lookup: embeddedCFF;
            font-size: 24;
        }
&lt;/pre&gt;
    
&lt;pre lang=&quot;mxml&quot;&gt;
    	&lt;![CDATA[
    		import mx.containers.Canvas;
    		
    		    import flash.display.Sprite;
		    import flashx.undo.UndoManager;
		    import mx.events.ScrollEvent;
		    import mx.events.FlexEvent;
		    import flashx.textLayout.conversion.TextConverter;
		    import flashx.textLayout.conversion.ConversionType;
		    import flashx.textLayout.compose.StandardFlowComposer;
		    import flashx.textLayout.container.ContainerController;
		    import flashx.textLayout.container.ScrollPolicy;
		    import flashx.textLayout.edit.EditManager;
		    import flashx.textLayout.edit.SelectionManager;
		    import flashx.textLayout.elements.TextFlow;
		    import flashx.textLayout.events.CompositionCompleteEvent;
		    import flashx.textLayout.events.SelectionEvent;
		    import flashx.textLayout.events.StatusChangeEvent;
		    import flashx.textLayout.events.TextLayoutEvent;
		    import flashx.textLayout.formats.TextLayoutFormat;
		    import flashx.textLayout.elements.Configuration;
		    import flash.text.engine.FontLookup;
		    import flash.text.engine.RenderingMode;
			
    		private function init():void {
                        testFont()
    			urlLoader = new URLLoader();
			urlLoader.addEventListener(Event.COMPLETE, onXMLLoaded);	
			urlLoader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
			urlLoader.load(new URLRequest(xmlURL));
    		}
    		
    		private function onXMLLoaded(event:Event):void {
	        	trace(&quot;XML loaded&quot;);
	        	textFlowAsString = event.target.data as String;
	        }
	        
	        private function errorHandler(event:Event):void {
	        	trace(&quot;Can&#039;t load XML : &quot; + event);
	        }
	        
	        public function set textFlowAsString(text:String):void {
			var importedTextFlow:TextFlow = TextConverter.importToFlow(text, TextConverter.TEXT_LAYOUT_FORMAT);
			if (importedTextFlow == null) {
				throw new Error(&quot;[SimpleTLFCanvas] set textFlowAsString : invalid string (&quot; + text + &quot;)&quot;);
			} else {
				initTextFlow(importedTextFlow);
			}
		}
			
		private function initTextFlow(textFlow:TextFlow):void {
			this.textFlow = textFlow;
			textCanvas = new Canvas();
			textCanvas.percentWidth = 100;
			textCanvas.percentHeight = 100;
			textCanvas.addEventListener(FlexEvent.CREATION_COMPLETE, onTextCanvasCreationComplete);
			addElement(textCanvas);
		}
		
		private function onTextCanvasCreationComplete(event:Event):void {
			textCanvas.removeEventListener(FlexEvent.CREATION_COMPLETE, onTextCanvasCreationComplete);
			textContainer = new Sprite();
			textCanvas.rawChildren.addChild(textContainer);
			textController = new ContainerController(textContainer, textCanvas.width, textCanvas.height);
			textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE, graphicStatusChangeEvent);
			textController.verticalScrollPolicy = ScrollPolicy.OFF;
 	           	textFlow.flowComposer.addController(textController); 
				textFlow.flowComposer.updateAllControllers();
			}
			
		private function graphicStatusChangeEvent(event:StatusChangeEvent):void {
			if (textFlow &amp;&amp; event.element.getTextFlow() == textFlow)
				textFlow.flowComposer.updateAllControllers();
		}

		private function testFont():void {
			var myEmbeddedFonts:Array = Font.enumerateFonts(false);
			var f:Font;
				
			for (var i:int=0; i
    
&lt;/pre&gt;

In all cases, the label is ok, with the global embedded font defined.


[COMMENT PART 4 (due to spam protection...)]
Note 1 : I also tried to override FontMananger priority in a config file, but don’t change anything :


flash.fonts.JREFontManager
flash.fonts.AFEFontManager
flash.fonts.BatikFontManager


Note 2 : In fact, I have two problems :
– I can&#039;t use new namespaces with an mx:Application, I must use 2006 namespace.
– I tested both &quot;library://ns.adobe.com/flex/mx&quot; and &quot;library://ns.adobe.com/flex/halo&quot;
– When I use Spark App, I lose completion and syntax coloration, so it is totaly unproductive
– I can’t embed font in TLF

Note 3 : When I display embedded font (Font.enumerateFonts(false)) With all embedded fonts I tested, isFontCompatible is always false ! (see sample)

Thanks for your help !

Yannick

</description>
		<content:encoded><![CDATA[<p>[COMMENT PART 1 (due to spam protection...)]<br />
Hi Peter,</p>
<p>TY for answer. If I change your application into a Spark application (s:App) : it works nice, font is embedded, same result on Linux &amp; Vista. But, always with s:App, if I load the </p>
<p>textFlow from a XML, it doesn&#8217;t work.</p>
<p>Moreover, I can&#8217;t compile your example as it, because of namespaces.</p>
<p><b>Case 1 : compile, no runtime error, but embedded font not work if xml loaded</b></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><span style="color: #7400FF;">&gt;</span></span>
<span style="color: #339933;">&lt;mx:Script&gt; ... &lt;/mx:Script&gt;</span></pre></div></div>

<p> AS : with &#8220;addChild&#8221; function</p>
<p><b>Case 2 : compile, no runtime error, but embedded font not work if xml loaded</b></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span></span>
<span style="color: #000000;">      xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&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;">      xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</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> ... <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p> AS : with &#8220;addElement&#8221; function</p>
<p><b>Case 3 : don&#8217;t compile</b></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span></span>
<span style="color: #000000;">      xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&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;">      xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p> Error : can&#8217;t resolve mx:Application into a component</p>
<p>[COMMENT PART 2 (due to spam protection...)]<br />
I googled many hours a few weeks ago and found nothing.<br />
The fact is I can run samples applications with TLF, which is in SDK4, so I am sure to use SDK4.<br />
 &#8211; I especialy take a look <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/" rel="nofollow">here</a><br />
 &#8211; different SDK4 build tested&#8230;<br />
 &#8211; putting the globalplayers.swc of SDK4 in external in the Fx project&#8230;<br />
I never understood why I could&#8217;nt use mx:Application ! Maybe this is a part of the solution for embedded font in TLF (?)</p>
<p><b>So now, my sample code</b></p>
<p>The XML loaded :</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextFlow</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ns.adobe.com/textLayout/2008&quot;</span> <span style="color: #000066;">whiteSpaceCollapse</span>=<span style="color: #ff0000;">&quot;collapse&quot;</span> <span style="color: #000066;">paddingTop</span>=<span style="color: #ff0000;">&quot;30&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">renderingMode</span>=<span style="color: #ff0000;">&quot;cff&quot;</span> <span style="color: #000066;">fontFamily</span>=<span style="color: #ff0000;">&quot;TahomaCFF&quot;</span> <span style="color: #000066;">fontLookup</span>=<span style="color: #ff0000;">&quot;embeddedCFF&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p</span> <span style="color: #000066;">fontSize</span>=<span style="color: #ff0000;">&quot;16&quot;</span> <span style="color: #000066;">textAlign</span>=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>This must be Embedded Tahoma.
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">fontWeight</span>=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>And this must be Tahoma bold<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TextFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>[COMMENT PART 3 (due to spam protection...)]<br />
The Application (I give the Spark App sample, even if I _must_ use an mx:Application)<br />
=&gt; given in another comment because my comment is too long&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&nbsp;
&nbsp;
&nbsp;
&nbsp;
        <span style="color: #a1a100;">@namespace s &quot;library://ns.adobe.com/flex/spark&quot;;</span>
        <span style="color: #a1a100;">@namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;</span>
&nbsp;
        <span style="color: #a1a100;">@font-face{</span>
            src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;C:/Windows/fonts/tahomabd.ttf&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
            <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;TahomaCFF&quot;</span><span style="color: #00AA00;">;</span>
            <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
            embedAsCFF<span style="color: #00AA00;">:</span> true<span style="color: #00AA00;">;</span>
        <span style="color: #00AA00;">&#125;</span>
&nbsp;
        <span style="color: #a1a100;">@font-face{</span>
            src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;C:/Windows/fonts/tahoma.ttf&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
            <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;TahomaCFF&quot;</span><span style="color: #00AA00;">;</span>
            embedAsCFF<span style="color: #00AA00;">:</span> true<span style="color: #00AA00;">;</span>
        <span style="color: #00AA00;">&#125;</span>
&nbsp;
        global <span style="color: #00AA00;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;TahomaCFF&quot;</span><span style="color: #00AA00;">;</span>
            font-lookup<span style="color: #00AA00;">:</span> embeddedCFF<span style="color: #00AA00;">;</span>
            <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">24</span><span style="color: #00AA00;">;</span>
        <span style="color: #00AA00;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;">    	<span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">    		import mx.containers.Canvas;</span>
&nbsp;
<span style="color: #000000;">    		    import flash.display.Sprite;</span>
<span style="color: #000000;">		    import flashx.undo.UndoManager;</span>
<span style="color: #000000;">		    import mx.events.ScrollEvent;</span>
<span style="color: #000000;">		    import mx.events.FlexEvent;</span>
<span style="color: #000000;">		    import flashx.textLayout.conversion.TextConverter;</span>
<span style="color: #000000;">		    import flashx.textLayout.conversion.ConversionType;</span>
<span style="color: #000000;">		    import flashx.textLayout.compose.StandardFlowComposer;</span>
<span style="color: #000000;">		    import flashx.textLayout.container.ContainerController;</span>
<span style="color: #000000;">		    import flashx.textLayout.container.ScrollPolicy;</span>
<span style="color: #000000;">		    import flashx.textLayout.edit.EditManager;</span>
<span style="color: #000000;">		    import flashx.textLayout.edit.SelectionManager;</span>
<span style="color: #000000;">		    import flashx.textLayout.elements.TextFlow;</span>
<span style="color: #000000;">		    import flashx.textLayout.events.CompositionCompleteEvent;</span>
<span style="color: #000000;">		    import flashx.textLayout.events.SelectionEvent;</span>
<span style="color: #000000;">		    import flashx.textLayout.events.StatusChangeEvent;</span>
<span style="color: #000000;">		    import flashx.textLayout.events.TextLayoutEvent;</span>
<span style="color: #000000;">		    import flashx.textLayout.formats.TextLayoutFormat;</span>
<span style="color: #000000;">		    import flashx.textLayout.elements.Configuration;</span>
<span style="color: #000000;">		    import flash.text.engine.FontLookup;</span>
<span style="color: #000000;">		    import flash.text.engine.RenderingMode;</span>
&nbsp;
<span style="color: #000000;">    		private 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;">                        testFont<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></span>
<span style="color: #000000;">    			urlLoader = new URLLoader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			urlLoader.addEventListener<span style="color: #66cc66;">&#40;</span>Event.COMPLETE, onXMLLoaded<span style="color: #66cc66;">&#41;</span>;	</span>
<span style="color: #000000;">			urlLoader.addEventListener<span style="color: #66cc66;">&#40;</span>IOErrorEvent.IO_ERROR, errorHandler<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			urlLoader.load<span style="color: #66cc66;">&#40;</span>new URLRequest<span style="color: #66cc66;">&#40;</span>xmlURL<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">    		<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">    		private function onXMLLoaded<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">	        	trace<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;XML loaded&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">	        	textFlowAsString = event.target.data as String;</span>
<span style="color: #000000;">	        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">	        private function errorHandler<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">	        	trace<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Can't load XML : &quot;</span> + event<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">	        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">	        public function set textFlowAsString<span style="color: #66cc66;">&#40;</span>text:String<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">			var importedTextFlow:TextFlow = TextConverter.importToFlow<span style="color: #66cc66;">&#40;</span>text, TextConverter.TEXT_LAYOUT_FORMAT<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			if <span style="color: #66cc66;">&#40;</span>importedTextFlow == null<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				throw new Error<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;[SimpleTLFCanvas] set textFlowAsString : invalid string (&quot;</span> + text + <span style="color: #ff0000;">&quot;)&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				initTextFlow<span style="color: #66cc66;">&#40;</span>importedTextFlow<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;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">		private function initTextFlow<span style="color: #66cc66;">&#40;</span>textFlow:TextFlow<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">			this.textFlow = textFlow;</span>
<span style="color: #000000;">			textCanvas = new Canvas<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			textCanvas.percentWidth = <span style="color: #cc66cc;">100</span>;</span>
<span style="color: #000000;">			textCanvas.percentHeight = <span style="color: #cc66cc;">100</span>;</span>
<span style="color: #000000;">			textCanvas.addEventListener<span style="color: #66cc66;">&#40;</span>FlexEvent.CREATION_COMPLETE, onTextCanvasCreationComplete<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			addElement<span style="color: #66cc66;">&#40;</span>textCanvas<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">		<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">		private function onTextCanvasCreationComplete<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">			textCanvas.removeEventListener<span style="color: #66cc66;">&#40;</span>FlexEvent.CREATION_COMPLETE, onTextCanvasCreationComplete<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			textContainer = new Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			textCanvas.rawChildren.addChild<span style="color: #66cc66;">&#40;</span>textContainer<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			textController = new ContainerController<span style="color: #66cc66;">&#40;</span>textContainer, textCanvas.width, textCanvas.height<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			textFlow.addEventListener<span style="color: #66cc66;">&#40;</span>StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE, graphicStatusChangeEvent<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			textController.verticalScrollPolicy = ScrollPolicy.OFF;</span>
<span style="color: #000000;"> 	           	textFlow.flowComposer.addController<span style="color: #66cc66;">&#40;</span>textController<span style="color: #66cc66;">&#41;</span>; </span>
<span style="color: #000000;">				textFlow.flowComposer.updateAllControllers<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">		private function graphicStatusChangeEvent<span style="color: #66cc66;">&#40;</span>event:StatusChangeEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">			if <span style="color: #66cc66;">&#40;</span>textFlow &amp;amp;&amp;amp; event.element.getTextFlow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> == textFlow<span style="color: #66cc66;">&#41;</span></span>
<span style="color: #000000;">				textFlow.flowComposer.updateAllControllers<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">		<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">		private function testFont<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">			var myEmbeddedFonts:Array = Font.enumerateFonts<span style="color: #66cc66;">&#40;</span>false<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			var f:Font;</span>
&nbsp;
<span style="color: #000000;">			for <span style="color: #66cc66;">&#40;</span>var i:int=<span style="color: #cc66cc;">0</span>; i</span></pre></div></div>

<p>In all cases, the label is ok, with the global embedded font defined.</p>
<p>[COMMENT PART 4 (due to spam protection...)]<br />
Note 1 : I also tried to override FontMananger priority in a config file, but don’t change anything :</p>
<p>flash.fonts.JREFontManager<br />
flash.fonts.AFEFontManager<br />
flash.fonts.BatikFontManager</p>
<p>Note 2 : In fact, I have two problems :<br />
– I can&#8217;t use new namespaces with an mx:Application, I must use 2006 namespace.<br />
– I tested both &#8220;library://ns.adobe.com/flex/mx&#8221; and &#8220;library://ns.adobe.com/flex/halo&#8221;<br />
– When I use Spark App, I lose completion and syntax coloration, so it is totaly unproductive<br />
– I can’t embed font in TLF</p>
<p>Note 3 : When I display embedded font (Font.enumerateFonts(false)) With all embedded fonts I tested, isFontCompatible is always false ! (see sample)</p>
<p>Thanks for your help !</p>
<p>Yannick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/comment-page-1/#comment-7243</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Fri, 12 Mar 2010 23:06:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/#comment-7243</guid>
		<description>This is probably slightly closer to your setup, but I still don&#039;t think I can reproduce the issue you&#039;re describing:
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx: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;
               creationComplete=&quot;init();&quot;&gt;
    
    &lt;fx:Style&gt;
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
        
        @font-face{
            src: url(&quot;C:/Windows/fonts/tahomabd.ttf&quot;);
            font-family: &quot;TahomaCFF&quot;;
            font-weight: bold;
            embedAsCFF: true;
        }
        
        @font-face{
            src: url(&quot;C:/Windows/fonts/tahoma.ttf&quot;);
            font-family: &quot;TahomaCFF&quot;;
            embedAsCFF: true;
        }
        
        global {
            font-family: &quot;TahomaCFF&quot;;
            font-lookup: embeddedCFF;
            font-size: 24;
        }
    &lt;/fx:Style&gt;
    
    &lt;fx:Script&gt;
        &lt;![CDATA[
            import flashx.textLayout.conversion.TextConverter;
            import flashx.textLayout.elements.TextFlow;
            
            private function init():void {
                var tFl:TextFlow = TextConverter.importToFlow(tFlow, TextConverter.TEXT_LAYOUT_FORMAT);
                ret.textFlow = tFl;
            }
        ]]&gt;
    &lt;/fx:Script&gt;
    
    &lt;fx:Declarations&gt;
        &lt;fx:String id=&quot;tFlow&quot; source=&quot;tFlow.txt&quot; /&gt;
    &lt;/fx:Declarations&gt;
    
    &lt;s:Label text=&quot;Spark Label&quot; /&gt;
    &lt;s:Button label=&quot;Spark Button&quot; /&gt;
    &lt;s:TextInput text=&quot;Spark TextInput&quot; /&gt;
    
    &lt;s:RichEditableText id=&quot;ret&quot; width=&quot;500&quot; /&gt;
    
&lt;/mx:Application&gt;
&lt;/pre&gt;

And the &lt;em&gt;tFlow.txt&lt;/em&gt; file is as follows:
&lt;pre lang=&quot;xml&quot;&gt;
&lt;TextFlow xmlns=&quot;http://ns.adobe.com/textLayout/2008&quot; fontLookup=&quot;embeddedCFF&quot; renderingMode=&quot;cff&quot; fontFamily=&quot;TahomaCFF&quot;&gt;
    &lt;p&gt;Paragraph 1 -- &lt;span fontWeight=&quot;bold&quot;&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit.&lt;/span&gt; Praesent nec placerat enim.&lt;/p&gt;
    &lt;p&gt;Paragraph 2 -- Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; &lt;span textDecoration=&quot;underline&quot;&gt;Aliquam volutpat tempor facilisis&lt;/span&gt;.&lt;/p&gt;
&lt;/TextFlow&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>This is probably slightly closer to your setup, but I still don&#8217;t think I can reproduce the issue you&#8217;re describing:</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;mx: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;">               creationComplete=<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:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
&nbsp;
        @font-face{
            src: url(&quot;C:/Windows/fonts/tahomabd.ttf&quot;);
            font-family: &quot;TahomaCFF&quot;;
            font-weight: bold;
            embedAsCFF: true;
        }
&nbsp;
        @font-face{
            src: url(&quot;C:/Windows/fonts/tahoma.ttf&quot;);
            font-family: &quot;TahomaCFF&quot;;
            embedAsCFF: true;
        }
&nbsp;
        global {
            font-family: &quot;TahomaCFF&quot;;
            font-lookup: embeddedCFF;
            font-size: 24;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</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;">            import flashx.textLayout.conversion.TextConverter;</span>
<span style="color: #000000;">            import flashx.textLayout.elements.TextFlow;</span>
&nbsp;
<span style="color: #000000;">            private 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;">                var tFl:TextFlow = TextConverter.importToFlow<span style="color: #66cc66;">&#40;</span>tFlow, TextConverter.TEXT_LAYOUT_FORMAT<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                ret.textFlow = tFl;</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;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span> id=<span style="color: #ff0000;">&quot;tFlow&quot;</span> source=<span style="color: #ff0000;">&quot;tFlow.txt&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;Spark Label&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Spark Button&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Spark TextInput&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichEditableText</span> id=<span style="color: #ff0000;">&quot;ret&quot;</span> width=<span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>And the <em>tFlow.txt</em> file is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextFlow</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ns.adobe.com/textLayout/2008&quot;</span> <span style="color: #000066;">fontLookup</span>=<span style="color: #ff0000;">&quot;embeddedCFF&quot;</span> <span style="color: #000066;">renderingMode</span>=<span style="color: #ff0000;">&quot;cff&quot;</span> <span style="color: #000066;">fontFamily</span>=<span style="color: #ff0000;">&quot;TahomaCFF&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Paragraph 1 -- <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">fontWeight</span>=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> Praesent nec placerat enim.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Paragraph 2 -- Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">textDecoration</span>=<span style="color: #ff0000;">&quot;underline&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Aliquam volutpat tempor facilisis<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TextFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/comment-page-1/#comment-7242</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Fri, 12 Mar 2010 22:50:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/#comment-7242</guid>
		<description>@Yannick,

The following example works for me with mx:Application, s:Label, s:Button, s:TextInput, and s:RichEditableText controls and CFF fonts:
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx: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;&gt;
    
    &lt;fx:Style&gt;
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
        
        @font-face{
            src: url(&quot;C:/Windows/fonts/tahomabd.ttf&quot;);
            font-family: &quot;TahomaCFF&quot;;
            font-weight: bold;
            embedAsCFF: true;
        }
        
        @font-face{
            src: url(&quot;C:/Windows/fonts/tahoma.ttf&quot;);
            font-family: &quot;TahomaCFF&quot;;
            embedAsCFF: true;
        }
        
        global {
            font-family: &quot;TahomaCFF&quot;;
            font-lookup: embeddedCFF;
            font-size: 24;
        }
    &lt;/fx:Style&gt;
    
    &lt;s:Label text=&quot;Spark Label&quot; /&gt;
    &lt;s:Button label=&quot;Spark Button&quot; /&gt;
    &lt;s:TextInput text=&quot;Spark TextInput&quot; /&gt;
    
    &lt;s:RichEditableText width=&quot;500&quot;&gt;
        &lt;s:textFlow&gt;
            &lt;s:TextFlow&gt;
                &lt;s:p&gt;Paragraph 1 -- &lt;s:span fontWeight=&quot;bold&quot;&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit.&lt;/s:span&gt; Praesent nec placerat enim.&lt;/s:p&gt;
                &lt;s:p&gt;Paragraph 2 -- Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; &lt;s:span textDecoration=&quot;underline&quot;&gt;Aliquam volutpat tempor facilisis&lt;/s:span&gt;.&lt;/s:p&gt;
            &lt;/s:TextFlow&gt;
        &lt;/s:textFlow&gt;
    &lt;/s:RichEditableText&gt;
    
&lt;/mx:Application&gt;
&lt;/pre&gt;

But this may depend on how complex your TextFlow is, and whether you&#039;re trying to mix embedded and device fonts, and whether you&#039;re trying to use a CFF embedd font with MX controls vs Spark controls, etc.

Peter</description>
		<content:encoded><![CDATA[<p>@Yannick,</p>
<p>The following example works for me with mx:Application, s:Label, s:Button, s:TextInput, and s:RichEditableText controls and CFF fonts:</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;mx: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 style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
&nbsp;
        @font-face{
            src: url(&quot;C:/Windows/fonts/tahomabd.ttf&quot;);
            font-family: &quot;TahomaCFF&quot;;
            font-weight: bold;
            embedAsCFF: true;
        }
&nbsp;
        @font-face{
            src: url(&quot;C:/Windows/fonts/tahoma.ttf&quot;);
            font-family: &quot;TahomaCFF&quot;;
            embedAsCFF: true;
        }
&nbsp;
        global {
            font-family: &quot;TahomaCFF&quot;;
            font-lookup: embeddedCFF;
            font-size: 24;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;Spark Label&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Spark Button&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Spark TextInput&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichEditableText</span> width=<span style="color: #ff0000;">&quot;500&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:textFlow</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextFlow</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:p</span><span style="color: #7400FF;">&gt;</span></span>Paragraph 1 -- <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:span</span> fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #7400FF;">&gt;</span></span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:span</span><span style="color: #7400FF;">&gt;</span></span> Praesent nec placerat enim.<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:p</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:p</span><span style="color: #7400FF;">&gt;</span></span>Paragraph 2 -- Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:span</span> textDecoration=<span style="color: #ff0000;">&quot;underline&quot;</span><span style="color: #7400FF;">&gt;</span></span>Aliquam volutpat tempor facilisis<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:span</span><span style="color: #7400FF;">&gt;</span></span>.<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:p</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:TextFlow</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:textFlow</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichEditableText</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>But this may depend on how complex your TextFlow is, and whether you&#8217;re trying to mix embedded and device fonts, and whether you&#8217;re trying to use a CFF embedd font with MX controls vs Spark controls, etc.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yannick Lacaute</title>
		<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/comment-page-1/#comment-7232</link>
		<dc:creator>Yannick Lacaute</dc:creator>
		<pubDate>Fri, 12 Mar 2010 14:24:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/#comment-7232</guid>
		<description>Hi,

&lt;b&gt;I don&#039;t manage to embed font in TLF.&lt;/b&gt;

Here is my development environment :
 - Vista
 - Flex Builder 3
 - SDK 4 (all last build tested)
 - using TLF
 - using halo (mx:Application)

I have an XML text file (Text Layout Format, not HTML) imported at runtime (TexTConverter.importToFlow).
In this xml I set theses options :
&lt;pre lang=&quot;text&quot;&gt; 
fontLookup=&quot;embeddedCFF&quot; renderingMode=&quot;cff&quot; fontFamily=&quot;Tahoma&quot;
&lt;/pre&gt;
I embed the font by using an external CSS file : 
&lt;pre lang=&quot;css&quot;&gt;
@font-face{
	src: url(&quot;assets/font/tahomabd.ttf&quot;);
	font-family: &quot;Tahoma&quot;;
	font-weight: bold;
	embedAsCFF: true;
}


@font-face{
	src: url(&quot;assets/font/tahoma.ttf&quot;);
	font-family: &quot;Tahoma&quot;;
	embedAsCFF: true;
}

mx&#124;global {
	font-family: &quot;Tahoma&quot;;
	font-lookup: embedded-c-f-f;
}
&lt;/pre&gt;
Labels, TextInputs etc are using the embedded font but not the TLF, which display text in Times New Roman...


&lt;b&gt;Note 1 :&lt;/b&gt;
I also tested to embed the font in AS :
&lt;pre lang=&quot;actionscript3&quot;&gt; 
[Embed(source=&#039;assets/font/tahoma.ttf&#039;, embedAsCFF=&#039;true&#039;, fontName=&#039;Tahoma&#039;, mimeType=&#039;application/x-font&#039;)] 
private static var TahomaFont:Class;
&lt;/pre&gt;
With or without &quot;Font.registerFont(TahomaFont);&quot; =&gt; don&#039;t change anything.


&lt;b&gt;Note 2 :&lt;/b&gt;
 When I generate a SWF Font with CS4 (by using SDK3 then SDK4) and use it like that :
&lt;pre lang=&quot;css&quot;&gt;
	@font-face{
	  src: url(&quot;assets/font/tahoma.swf&quot;);
	  font-family: &quot;Tahoma&quot;;
	  embedAsCFF: true;
        }
&lt;/pre&gt;
I have a compilation error : le paramètre de transcodage embedAsCFF n&#039;est pas pris en charge par 

flex2.compiler.media.MovieTranscoder
If I dont set the option &quot;embedAsCFF&quot;, the font is embedded and works fine, except for TLF of course...

&lt;b&gt;Note 3 :&lt;/b&gt;
 If I don&#039;t set the font fontLookup option in the XML text file, it works nice, the TLF use Tahoma but the font used is not 

the embedded Tahoma font (I have differents results on Linux and Vista, just for TLF texts).

&lt;b&gt;Note 4 :&lt;/b&gt;
 I am sure to compile with SDK 4, I even tried different SDK.

&lt;b&gt;Note 5 :&lt;/b&gt;
 I can&#039;t turn my application into a Spark Application. The fact is that I have only seen TLF examples with a Spark 

Application, maybe it&#039;s not possible to embed font in TLF with a Halo App ?

&lt;b&gt;Note 6 :&lt;/b&gt;
 I also tried to import TextFlow with a Configuration (for overriding options in the initial format, with CFF etc) : do 

nothing.


Please help... I read Adobe TLF forum, many blog... and found nothing !!

What&#039;s wrong with this code ??
Thanks

Yannick</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p><b>I don&#8217;t manage to embed font in TLF.</b></p>
<p>Here is my development environment :<br />
 &#8211; Vista<br />
 &#8211; Flex Builder 3<br />
 &#8211; SDK 4 (all last build tested)<br />
 &#8211; using TLF<br />
 &#8211; using halo (mx:Application)</p>
<p>I have an XML text file (Text Layout Format, not HTML) imported at runtime (TexTConverter.importToFlow).<br />
In this xml I set theses options :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">fontLookup=&quot;embeddedCFF&quot; renderingMode=&quot;cff&quot; fontFamily=&quot;Tahoma&quot;</pre></div></div>

<p>I embed the font by using an external CSS file :</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@font-face{</span>
	src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;assets/font/tahomabd.ttf&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;Tahoma&quot;</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
	embedAsCFF<span style="color: #00AA00;">:</span> true<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #a1a100;">@font-face{</span>
	src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;assets/font/tahoma.ttf&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;Tahoma&quot;</span><span style="color: #00AA00;">;</span>
	embedAsCFF<span style="color: #00AA00;">:</span> true<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
mx|global <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;Tahoma&quot;</span><span style="color: #00AA00;">;</span>
	font-lookup<span style="color: #00AA00;">:</span> embedded-c-f-f<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Labels, TextInputs etc are using the embedded font but not the TLF, which display text in Times New Roman&#8230;</p>
<p><b>Note 1 :</b><br />
I also tested to embed the font in AS :</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>Embed<span style="color: #000000;">&#40;</span><span style="color: #004993;">source</span>=<span style="color: #990000;">'assets/font/tahoma.ttf'</span><span style="color: #000066; font-weight: bold;">,</span> embedAsCFF=<span style="color: #990000;">'true'</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">fontName</span>=<span style="color: #990000;">'Tahoma'</span><span style="color: #000066; font-weight: bold;">,</span> mimeType=<span style="color: #990000;">'application/x-font'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span> 
<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #6699cc; font-weight: bold;">var</span> TahomaFont<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Class</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>With or without &#8220;Font.registerFont(TahomaFont);&#8221; =&gt; don&#8217;t change anything.</p>
<p><b>Note 2 :</b><br />
 When I generate a SWF Font with CS4 (by using SDK3 then SDK4) and use it like that :</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">	<span style="color: #a1a100;">@font-face{</span>
	  src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;assets/font/tahoma.swf&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;Tahoma&quot;</span><span style="color: #00AA00;">;</span>
	  embedAsCFF<span style="color: #00AA00;">:</span> true<span style="color: #00AA00;">;</span>
        <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>I have a compilation error : le paramètre de transcodage embedAsCFF n&#8217;est pas pris en charge par </p>
<p>flex2.compiler.media.MovieTranscoder<br />
If I dont set the option &#8220;embedAsCFF&#8221;, the font is embedded and works fine, except for TLF of course&#8230;</p>
<p><b>Note 3 :</b><br />
 If I don&#8217;t set the font fontLookup option in the XML text file, it works nice, the TLF use Tahoma but the font used is not </p>
<p>the embedded Tahoma font (I have differents results on Linux and Vista, just for TLF texts).</p>
<p><b>Note 4 :</b><br />
 I am sure to compile with SDK 4, I even tried different SDK.</p>
<p><b>Note 5 :</b><br />
 I can&#8217;t turn my application into a Spark Application. The fact is that I have only seen TLF examples with a Spark </p>
<p>Application, maybe it&#8217;s not possible to embed font in TLF with a Halo App ?</p>
<p><b>Note 6 :</b><br />
 I also tried to import TextFlow with a Configuration (for overriding options in the initial format, with CFF etc) : do </p>
<p>nothing.</p>
<p>Please help&#8230; I read Adobe TLF forum, many blog&#8230; and found nothing !!</p>
<p>What&#8217;s wrong with this code ??<br />
Thanks</p>
<p>Yannick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/comment-page-1/#comment-4608</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Fri, 17 Jul 2009 15:30:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/#comment-4608</guid>
		<description>I&#039;d probably recommend using the new UITLFTextField class wherever possible. Although I&#039;m semi-certain that they do not work with all Halo controls, so you may not be able to set the &lt;code&gt;textFieldClass&lt;/code&gt; style globally.

Peter</description>
		<content:encoded><![CDATA[<p>I&#8217;d probably recommend using the new UITLFTextField class wherever possible. Although I&#8217;m semi-certain that they do not work with all Halo controls, so you may not be able to set the <code>textFieldClass</code> style globally.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob McKeown</title>
		<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/comment-page-1/#comment-4592</link>
		<dc:creator>Rob McKeown</dc:creator>
		<pubDate>Thu, 16 Jul 2009 16:47:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/#comment-4592</guid>
		<description>Is there any reason why you would not want to automatically set the textFieldClass to the new TLF one? It seems like you would always want to do it in the stylesheet for all Labels (and Text too?) so that you can forget about the difference in the rest of the app.</description>
		<content:encoded><![CDATA[<p>Is there any reason why you would not want to automatically set the textFieldClass to the new TLF one? It seems like you would always want to do it in the stylesheet for all Labels (and Text too?) so that you can forget about the difference in the rest of the app.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/comment-page-1/#comment-4231</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Wed, 17 Jun 2009 20:09:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/#comment-4231</guid>
		<description>NBiehl,

I haven&#039;t tried this with the Halo DataGrid yet. Can you please file a bug at &lt;a href=&quot;http://bugs.adobe.com/flex/&quot; rel=&quot;nofollow&quot;&gt;http://bugs.adobe.com/flex/&lt;/a&gt; and include a simple test case and myself or somebody else can take a look at it.

Thanks,
Peter</description>
		<content:encoded><![CDATA[<p>NBiehl,</p>
<p>I haven&#8217;t tried this with the Halo DataGrid yet. Can you please file a bug at <a href="http://bugs.adobe.com/flex/" rel="nofollow">http://bugs.adobe.com/flex/</a> and include a simple test case and myself or somebody else can take a look at it.</p>
<p>Thanks,<br />
Peter</p>
]]></content:encoded>
	</item>
</channel>
</rss>

