• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Does AS3 support Unicode font?

Explorer ,
Jan 12, 2011 Jan 12, 2011

Copy link to clipboard

Copied

I want to use Unicode font,such as GBK,to show some text,like follows:

var_tf:TextFormat=new TextFormat();
_tf.font="黑体";
_tf.size=20;
_tf.bold=true;
_tf.color=0xFFFFFF;

var _txt:TextField=new TextField();       
_txt.wordWrap=false;
_txt.width=300;
_txt.x=100;
_txt.y=50;
_txt.appendText("你好");
_txt.setTextFormat(_tf);

addChild(_txt);

When I run above code,I find the text style is not what I want,the font style don't change!  Doesn't  ActionScript3 support unicode font? How to realize unicode font?

Thanks

TOPICS
ActionScript

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 13, 2011 Jan 13, 2011

Copy link to clipboard

Copied

LATEST

Flash of course supports unicode since version 6

I don't have the font "黑体" but using a Chinese font I have on my Mac, this works just fine:

...

           var textfield:TextField = new TextField();
            with(textfield){
                defaultTextFormat = new TextFormat("Heiti SC Medium", 20, 0);
                text = "你好";
            }
            addChild(textfield);

...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines