Think I figured part of the problem out. Seems Darron Schall’s blog post is still valid as I am able to get this to work on Label or Button components but TextArea (which I first tried) is a different story. So it seems that TextArea is doing something under the covers that Label and Button don’t.

 

Any ideas?

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Lance Linder
Sent: Wednesday, August 30, 2006 6:34 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Include fonts in RSL Flex2

 

I have been scowering the internet for information on how to embed fonts in an RSL for Flex2.

 

I ran accress this posting by Darron Schall but it looks like it is for Flex 1.5? Anyway I gave it a try but it doesn’t work for me. I set up 2 projects, 1 regular flex project and another as a library project. My regular project references the library project as an RSL and in my library project I created one component with the @font-face css tag in the <mx:Style> tag. I also created a manifest file and set up the library project to use the manifest file.

 

Everything compiles right and my component from the RSL shows up in my main app but when I try to use the font in the RSL the text in my main app disappears (ie just like in Flash if you tell it to use embedded fonts but the font doesn’t exist).

 

This has to be possible with Flex 2! Heck fonts alone are one of the most important things to stuff in an RSL half the time!

 

What am I doing wrong? Is there some more documentation on this that I missed or a more recent blog post that I missed?

 

Thanks for any help!

 

Here is the code I have…..

 

--- application code ---

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

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:mystuff="http://mystuff" layout="absolute">

            <mx:Style>

                        <![CDATA[

                                    TextArea {

                                                font-family: mainFont;    

                                    }

                        ]]>

            </mx:Style>

           

            <mystuff:MyStuff width="10" height="10" />

            <mx:TextArea x="10" y="10" width="533" height="434" text="Hello There!"/>

</mx:Application>

 

--- rsl component code ---

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

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="10" height="10"  backgroundColor="0x000000">

            <mx:Style>

                        <![CDATA[

                                    @font-face {

                                                src:url("verdana.ttf");

                                                font-family: mainFont;

                                                font-style: normal;         

                                    }

                        ]]>

            </mx:Style>

</mx:Canvas>

 

--- manifest file ---

<?xml version="1.0"?>

<componentPackage>

    <component id="MyStuff" class="MyStuff"/>

</componentPackage>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to