Flash Actionscript 添加字体样式,解决火星文不能显示 TLFTextFile

public static function setCSS(myTLFTextField:TLFTextField){

            //var format1:TextLayoutFormat = new TextLayoutFormat();

            //format1.color = 0x660000;

            //format1.fontFamily = "Arial, Helvetica, _sans";

            //format1.fontSize = 14;

            //format1.paragraphSpaceBefore=0;

            //format1.paragraphSpaceAfter=20;

            //var format2:TextLayoutFormat = new TextLayoutFormat();

            //format2.color = 0x990000;

            //format2.fontSize = 16;

            //format2.fontWeight = FontWeight.BOLD;

            //tf.format = format2;            

            //var fmt:TextFormat = new TextFormat("微软简粗黑",10.8,null,100);

            //tf.autoSize = TextFieldAutoSize.CENTER;

            var myFormat:TextLayoutFormat = new TextLayoutFormat();

            //myFormat.textIndent = 8;

            //myFormat.color = 0x336633;

            myFormat.fontFamily = "Microsoft YaHei";

            myFormat.fontSize = 10.8;

            myFormat.fontWeight = FontWeight.BOLD;

            myTLFTextField.autoSize = TextFieldAutoSize.CENTER;

            var myTextFlow:TextFlow = myTLFTextField.textFlow;

            myTextFlow.hostFormat = myFormat;

            myTextFlow.flowComposer.updateAllControllers();

        }

 

你可能感兴趣的:(actionscript)