Adobe-Runtime-Support
Adobe-Runtime-Support copied to clipboard
A bug for vertical text in TextField
When using TextField to vertically arrange Chinese characters, sometimes the last Chinese character will be lost when the container is resized. In order to adapt to the screens of different mobile devices, container Resize is inevitable. This issue has been bothering me for a long time. By setting the container size specifically for different models of devices, the issue can be temporarily solved. However, every time the AIRSDK is upgraded, the container size needs to be readjusting (usually a few minor adjustments of pixels can solve it).
This issue exists in AIRSDK from 33.1 to 51.2, and it is present on both iOS and Android. @ajwfrost
`private function testTextFieldVerticalTextIssue():void { var _tfmt1:TextFormat = new TextFormat("_sans", 150, 0); var _tfmt2:TextFormat = new TextFormat("_sans", 120, 0); _tfmt1.align = _tfmt2.align = TextFormatAlign.LEFT;
var _txt1:TextField = new TextField();
_txt1.defaultTextFormat = _tfmt1;
_txt1.border = true;
_txt1.text = "测\n试";
_txt1.width = _txt1.textWidth + 12;
_txt1.height = _txt1.textHeight + 4;
_txt1.x = 1;
_txt1.y = 1;
var _txt2:TextField = new TextField();
_txt2.defaultTextFormat = _tfmt2;
_txt2.border = true;
_txt2.text = "字";
_txt2.width = _txt2.textWidth + 12;
_txt2.height = _txt2.textHeight + 4;
_txt2.x = 1;
_txt2.y = _txt1.y + _txt1.height + 2;
var container:Sprite = new Sprite();
container.addChild(_txt1);
container.addChild(_txt2);
container.width = _txt1.width + 2;
container.height = _txt1.height + _txt2.height + 4;
container.x = 300;
container.y = 400;
addChild(container);
var timer:Timer = new Timer(1500, 100);
timer.addEventListener(TimerEvent.TIMER, function(e:TimerEvent):void {
container.width = 200 + 50*Math.random();
container.height = 500 + 80*Math.random();
});
timer.start();
}`
Will this bug be fixed in the future? @ajwfrost I don't have an effective way to solve this problem now. There are always some users complaining about this defect.Finally, users can only choose to uninstall my app ...
Hi - we can probably look at this, I think it may be caused by an mis-measuring of the text sizes when it's using a different font to what's selected (i.e. when the fallback process happens). Not 100% sure whether we would be able to solve it though .. it's possible that the behaviour would be better with the FTE based rendering so we can check that too..)
thanks