/ Published in: ActionScript 3
                    
                                        
How to embed a font in a Flash Builder 4* project?
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
package
{
import flash.display.MovieClip;
import flash.text.*;
public class QuickTest extends MovieClip
{
// Embed the font Verdana
[Embed(source="c:/windows/fonts/verdana.ttf", fontFamily="Verdana", embedAsCFF="false")]
private var verdana:Class;
public function QuickTest ()
{
// Set the font with a TextFormat object
var format:TextFormat = new TextFormat( );
format.font = "Verdana";
format.size = 56;
var t:TextField = new TextField( );
t.embedFonts = true;
// Format text using the font Verdana
t.defaultTextFormat = format;
t.text = "hello world";
addChild(t);
}
}
}
URL: http://forums.adobe.com/message/3276591#3276591
Comments
 Subscribe to comments
                    Subscribe to comments
                
                