Hi,

Yes, you can embed the font and use html text as well as rotate the
textarea. But when you embed the font via [Embed(..)] metatag, only normal
style of font is embedded i.e. bold & italic font outlines are not embedded.
I don't know, how to make sure that bold & italic outlines are also embedded
via metatag or Flex.


1) If you don't bold or italic styles in your text, following is the
quickest approach:


##HTMLTextWithFontEmbedding.mxml##

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"; width="425"
height="400" >
   <mx:Style>
      @font-face { fontFamily:myfont;
src:url("file:///c:/windows/fonts/Georgia.TTF"); } 

   </mx:Style>
   <mx:Script>
    <![CDATA[
    
        function setText(event)
        {
            event.target.htmlText = "<font face='myfont'
color='#FF0000'>some text</font>";
        }
    
    ]]>
    
   </mx:Script>
    
  
   <mx:Label fontFamily="myfont" fontSize="16" id="out" _rotation="45"
text="This is a label" alpha="20"/> 
   <mx:TextArea id="_ta" fontFamily="myfont" _rotation="45"
creationComplete="setText(event);"/>
</mx:Application>



2) If you want bold & italic styles in your text, you can adopt following
appraoch but it requires Macromedia Flash authoring tool & knowledge to use
it:

With Flash Authoring tool, 

* create flash movie
* open library
* create three font symbols with normal, bold and italic font outlines
embedded.
* export the swf. Say its name "georgiaEmbedded.swf", it has entire Georgia
font embedded with normal, bold & italic font outlines.
* copy the swf(georgiaEmbedded.swf) beside your mxml file in flex server.


Create a MXML file can have this code:

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"; width="425"
height="400" >
   <mx:Script>
    <![CDATA[
    
        //embed the entire swf file, so that font symbols are merged with
the main swf generated from this mxml.
       [Embed(source="georgiaEmbedded.swf")]
        var georgiaFontSWF;
  
          function setText(event)
        {
                       
            event.target.htmlText = "<font face='Georgia'>Normal
Text<br><b>Bold Text</b><br><i>Italic Text</i></font>";
        }
    ]]>
    
   </mx:Script>
    
  
   <mx:Label fontFamily="Georgia" fontSize="16" id="out" _rotation="45"
text="This is a label" alpha="20"/> 
   <mx:TextArea id="_ta" fontFamily="Georgia" _rotation="10" width="100"
height="100" creationComplete="setText(event);"/>

</mx:Application>


Run it, it would work...

Hope that helps...

-abdul

-----Original Message-----
From: Andy Goodfellow [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 13, 2005 7:58 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] htmlText and embedded fonts


Has this been answered anywhere? I'm having the same issues with
embedded fonts not being displayed in the htmlText of an mx:TextArea
field.

-Andy

On 1/19/05, jayar_flexer <[EMAIL PROTECTED]> wrote:
>  
>  Hi,
>  i have a textarea with htmltext and want to rotate it 180 degree.
>  Therefor i have to embed the font used in the textfield. But when the
>  font is embedded and i use the htmlText-tag, no text will be 
>  displayed in the textfield. If i click the right mouse button on the 
>  textfield and select 'select all', the text is in the clipboard.
>  How can i use htmltext, embedded fonts and rotation?
>  Thanks,
>  Jens
>  
>  
>  
>  
>  
>  ________________________________
>  Yahoo! Groups Links
>  
>  
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/flexcoders/
>   
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>   
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to