embededFonts 를 사용한 TextField , TextArea , TextInput 폰트 관리 하는 방법 입니다.
-
var hyfont:Font = new HYKANG(); // 할 필요 없음
-
-
var format:TextFormat = new TextFormat();
-
format.font =
hyfont.fontName; // format.font = "폰트이름";
으로 대체 가능
-
format.bold =
true;
-
format.size =
15;
-
-
atxt.text =
"플래시 액션스크립트 카페, 정기 스터디 모임, 우왕
굿"; // TextArea
-
atxt.setStyle("antiAliasType", AntiAliasType.ADVANCED);
-
atxt.setStyle("embedFonts", true);
-
atxt.setStyle("textFormat",format);
-
-
itxt.text =
"플래시 액션스크립트 카페, 정기 스터디 모임, 우왕
굿"; // TextInput
-
itxt.setStyle("antiAliasType", AntiAliasType.ADVANCED);
-
itxt.setStyle("embedFonts", true);
-
itxt.setStyle("textFormat",format);
-
-
dtxt.text =
"플래시액션스크립트 카페, 정기 스터디 모임, 우왕
굿"; // TextField
-
dtxt.antiAliasType = AntiAliasType.ADVANCED;
-
dtxt.embedFonts
= true;
-
dtxt.setTextFormat(format);
-
|
보통 한글 폰트를 embed 없이 사용하면 깨짐 현상이 발생하는데 그 현상을 없애주는 방법 입니다.
라이브러리 - > New Font - >
Name : 자신이 확인가능한 이름
Fonts : embed 하고 싶은 폰트
이렇게 라이브 러리에 새로운 폰트를 만든후에 그 해당 폰트를 적용 시켜 주면 깨짐이 없이 컴파일이 됨니다.
Properties 창에 있는 Embed... 버튼으로 적용해 줄수 있지만, 동적으로 TextField 나 TextArea ,
TextInput 을 생성했을때는 위와 같은 방법으로 사용하여야 합니다.