Using bold and italic with embedded fonts : Font : TextField Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » TextField » Font »

 

Using bold and italic with embedded fonts


 
package {
  import flash.display.*;
  import flash.text.*;

  public class Main extends Sprite {
    FontEmbedder;

    public function Main() {
      var t:TextField = new TextField(  );
      t.embedFonts = true;
      t.htmlText = "<FONT FACE='Verdana'>Hello <b>world</b></FONT>";

      addChild(t);
    }
  }
}
  class FontEmbedder {
    [Embed(source="c:/windows/fonts/verdana.ttf",
           fontFamily="Verdana")]
    private var verdana:Class;

    [Embed(source="c:/windows/fonts/verdanab.ttf",
           fontFamily="Verdana",
           fontWeight="bold")]
    private var verdanabold:Class;
  }

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo TextField
» Font