Highlighted

Chinese characters are displayed as blank box on the TextField in The new HTC One with Android 4.4.2

New Here ,
Mar 17, 2014

Copy link to clipboard

Copied

I use the AIR SDK is 4.0.0.1628, mobile phone is The new HTC One with Android 4.4.2 in Taiwan.

When the application installed on the The new HTC One with Android 4.4.2, chinese characters in TextField displayed as blank.

Hope it can be fixed as soon as possible.

The test code:

package

{

          import flash.display.Sprite;

          import flash.display.StageAlign;

          import flash.display.StageScaleMode;

          import flash.text.Font;

          import flash.text.TextField;

          import flash.text.TextFieldAutoSize;

          import flash.text.TextFormat;

          public class TestFont extends Sprite

          {

                    public function TestFont()

                    {

                              stage.scaleMode = StageScaleMode.NO_SCALE;

                              stage.align = StageAlign.TOP_LEFT;

                              var sprite:Sprite = new Sprite();

                              var value1:String = "简体中文测试";

                              var value2:String = "繁體中文測試";

                              var txt11:TextField = createTextField(null, "11 "+value1);

                              txt11.x = 10;

                              txt11.y = 10;

                              sprite.addChild(txt11);

                              var txt12:TextField = createTextField(null, "12 "+value2);

                              txt12.x = txt11.x + txt11.width;

                              txt12.y = txt11.y;

                              sprite.addChild(txt12);

                              ///

                              var txt21:TextField = createTextField("STHeitiTC-Medium","21 "+value1);

                              txt21.x = 10;

                              txt21.y = txt11.y + txt11.height;

                              sprite.addChild(txt21);

                              var txt22:TextField = createTextField("MSYH","22 "+value2);

                              txt22.x = txt21.x + txt21.width;

                              txt22.y = txt21.y;

                              sprite.addChild(txt22);

                              var lastY:int = txt22.y + txt22.height;

                              var fonts:Array = Font.enumerateFonts(true);

                              var index:int = 0;

                              for each (var font1:Font in fonts)

                              {

                                        index++;

                                        var txtF:TextField = createTextField(font1.fontName, index + "/" + fonts.length + " " + font1.fontName + " "+value1 +" " + value2);

                                        txtF.x = 10;

                                        txtF.y = lastY;

                                        sprite.addChild(txtF);

                                        lastY += txtF.height;

                              }

                              addChild(sprite);

                    }

                    public function createTextField(font:String, value:String):TextField{

                              var txt:TextField = new TextField();

                              txt.autoSize = TextFieldAutoSize.LEFT;

                              var format:TextFormat = new TextFormat();

                              if(font != null){

                                        format.font = font;

                                        txt.defaultTextFormat = format;

                                        txt.setTextFormat(format);

                              }

                              txt.text = value;

                              var dformat:TextFormat = txt.defaultTextFormat;

                              if(dformat != null){

                                        txt.text = value + " |" + dformat.font;

                              }

                              if(font != null){

                                        txt.setTextFormat(format);

                              }

                              return txt;

                    }

          }

}

TOPICS
Performance issues

Views

190

Likes

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

Chinese characters are displayed as blank box on the TextField in The new HTC One with Android 4.4.2

New Here ,
Mar 17, 2014

Copy link to clipboard

Copied

I use the AIR SDK is 4.0.0.1628, mobile phone is The new HTC One with Android 4.4.2 in Taiwan.

When the application installed on the The new HTC One with Android 4.4.2, chinese characters in TextField displayed as blank.

Hope it can be fixed as soon as possible.

The test code:

package

{

          import flash.display.Sprite;

          import flash.display.StageAlign;

          import flash.display.StageScaleMode;

          import flash.text.Font;

          import flash.text.TextField;

          import flash.text.TextFieldAutoSize;

          import flash.text.TextFormat;

          public class TestFont extends Sprite

          {

                    public function TestFont()

                    {

                              stage.scaleMode = StageScaleMode.NO_SCALE;

                              stage.align = StageAlign.TOP_LEFT;

                              var sprite:Sprite = new Sprite();

                              var value1:String = "简体中文测试";

                              var value2:String = "繁體中文測試";

                              var txt11:TextField = createTextField(null, "11 "+value1);

                              txt11.x = 10;

                              txt11.y = 10;

                              sprite.addChild(txt11);

                              var txt12:TextField = createTextField(null, "12 "+value2);

                              txt12.x = txt11.x + txt11.width;

                              txt12.y = txt11.y;

                              sprite.addChild(txt12);

                              ///

                              var txt21:TextField = createTextField("STHeitiTC-Medium","21 "+value1);

                              txt21.x = 10;

                              txt21.y = txt11.y + txt11.height;

                              sprite.addChild(txt21);

                              var txt22:TextField = createTextField("MSYH","22 "+value2);

                              txt22.x = txt21.x + txt21.width;

                              txt22.y = txt21.y;

                              sprite.addChild(txt22);

                              var lastY:int = txt22.y + txt22.height;

                              var fonts:Array = Font.enumerateFonts(true);

                              var index:int = 0;

                              for each (var font1:Font in fonts)

                              {

                                        index++;

                                        var txtF:TextField = createTextField(font1.fontName, index + "/" + fonts.length + " " + font1.fontName + " "+value1 +" " + value2);

                                        txtF.x = 10;

                                        txtF.y = lastY;

                                        sprite.addChild(txtF);

                                        lastY += txtF.height;

                              }

                              addChild(sprite);

                    }

                    public function createTextField(font:String, value:String):TextField{

                              var txt:TextField = new TextField();

                              txt.autoSize = TextFieldAutoSize.LEFT;

                              var format:TextFormat = new TextFormat();

                              if(font != null){

                                        format.font = font;

                                        txt.defaultTextFormat = format;

                                        txt.setTextFormat(format);

                              }

                              txt.text = value;

                              var dformat:TextFormat = txt.defaultTextFormat;

                              if(dformat != null){

                                        txt.text = value + " |" + dformat.font;

                              }

                              if(font != null){

                                        txt.setTextFormat(format);

                              }

                              return txt;

                    }

          }

}

TOPICS
Performance issues

Views

191

Likes

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
Mar 17, 2014 0

Have something to add?

Join the conversation