[ActionScript 3.0] 폰트 임베디드 , Embed font > 개발자팁

개발자팁

개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.

[ActionScript 3.0] 폰트 임베디드 , Embed font 정보

Flash [ActionScript 3.0] 폰트 임베디드 , Embed font

본문

package {

import flash.util.describeType;
import flash.display.MovieClip;
import flash.display.TextField;
import flash.text.TextFormat;
import flash.text.AntiAliasType;
 
   public class Test extends MovieClip {
   
      // be sure this is pointing to a ttf font in your hardrive
      [Embed(source="C:\WINDOWS\Fonts\somefont.ttf", fontFamily="foo")]
      public var bar:String;
     
      public function Test() {
               
          var format:TextFormat      = new TextFormat();
          format.font      = "foo";
          format.color                = 0xFFFFFF;
          format.size                 = 130;

          var label:TextField         = new TextField();
          label.embedFonts            = true;
          label.autoSize              = TextFieldAutoSize.LEFT;
          label.antiAliasType         = AntiAliasType.ADVANCED;
          label.defaultTextFormat     = format;
          label.text                  = "Hello World!";
          addChild(label);
       }
    }
추천
1
  • 복사

댓글 0개

© SIRSOFT
현재 페이지 제일 처음으로