See the embedded font post on my blog.  The control  needs to have the right 
SWF context.  Does it work if you turn off RSLs?


On 10/25/11 3:01 AM, "Baz" <li...@thinkloop.com> wrote:






Hello,

Anyone have any idea why the embedded font in the following basic application 
does not show up?

<?xml version="1.0" encoding="utf-8"?>

<s:Application

         xmlns:fx="http://ns.adobe.com/mxml/2009";

         xmlns:s="library://ns.adobe.com/flex/spark 
<http://ns.adobe.com/flex/spark> "

         xmlns:mx="library://ns.adobe.com/flex/mx <http://ns.adobe.com/flex/mx> 
"

         creationComplete="application1_initializeHandler(event)"

         minWidth="955" minHeight="600">



         <fx:Script>

                   <![CDATA[

                             import flash.text.engine.FontLookup;

                             import flashx.textLayout.elements.TextFlow;

                             import mx.events.FlexEvent;

                             import spark.utils.TextFlowUtil;



                             [Embed(source="ZemkeHandITCTT.ttf", 
fontFamily="zem", embedAsCFF="true", fontWeight="normal", 
mimeType="application/x-font")]

                             public const zem_embed_class:Class;



                             protected var embeddedFontMarkup:XML =  <p 
fontFamily="zem" fontLookup="embeddedCFF"><span>Some content</span></p>;



                             protected function 
application1_initializeHandler(event:FlexEvent):void          {

                                       var textFlow:TextFlow = 
TextFlowUtil.importFromXML(embeddedFontMarkup);

                                       textFlow.fontFamily = 'zem';

                                       textFlow.fontLookup = 
FontLookup.EMBEDDED_CFF;

                                       one.textFlow = textFlow;

                             }

                   ]]>

         </fx:Script>



         <s:RichEditableText id="one" width="500" height="204" 
renderingMode="cff" fontLookup="embeddedCFF" />

</s:Application>



I know the font works because if I specify any embedded font directly in the 
RichEditableText, the specified embedded fonts shows up.



Thanks,

Baz








--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to