Hi,

If you google "Flex + [Embed]" that will give you lots of tutorials, but simply, the [Embed] meta-tag in AS3 allows the compiler to embed external assets like images and fonts at compile time... You can use similar methodology as you do for Flash CS4 for Pure AS3 classesput your [Embed] code in that, then declare a class for it underneath - you can instanciate the class in the same code or you can use the <mx:Style> property to include fonts and apply them: http://www.adobe.com/devnet/flex/quickstart/embedding_assets/

   HTH

   Glen

   Example 1, pure AS3:
public class Main extends flash.display.Sprite
[Embed(systemFont="Aharoni", fontName='TextFont', fontWeight='bold', unicodeRange='U+002C-U+005A', mimeType='application/x-font') ]
       private var AnotherClass:Class;

   protected function addedToStageHandler(event:Event):void {

           label = new TextField();
           label.htmlText = "TESTING 123";
           label.embedFonts = true;
var format:TextFormat = new TextFormat(); //You can refer to your font by fonName anywhere in the SWF - e.g. from another class once it's embedded.
           format.font = "TextFont";
           format.bold = true;
           format.color = 0xFFFFFF;
            label.setTextFormat(format);
   }
}

Example 2 in a Flex stylesheet:

@font-face {
   src:url("../embedded_assets/fonts/verdana.ttf");
   font-family:"Verdana";
}
@font-face {
   src:url("../embedded_assets/fonts/verdanab.ttf");
   font-family:"Verdana";
   font-weight:bold;
}
.alertButton {
   font-family:Verdana;
}






Michael Teniente wrote:
I want to ask a question about embedding fonts without flash. I want to use 3.0 
in the flex builder. Can u give me a sample of how that is done? I searched the 
online tutorials but all I get is samples of how to do it in flash. Well, if I 
don't have flash..what good is that?
I need a 3.0 tutorial using the Flex Builder. Can u help me out? Thanks,
mike t.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


--

Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to