Text Field Broken

Hi! I have errors when displaying text in my app. It seems to be broken as the image


My code:
var txtFormat:TextFormat = new TextFormat(“img/fonts/Roboto-Black.ttf”,fontSize,txtColor);
_ txtFormat.align = TextFormatAlign.CENTER;_
_ txtFormat.bold = true;_
_ txt = new TextField();_
_ addChild(txt);_
_ txt.defaultTextFormat = txtFormat;_
_ txt.width = br.width;_
_ txt.height = fontSize + 5;_
_ _
_ txt.wordWrap = true;_
_ txt.autoSize = TextFieldAutoSize.CENTER;_
_ txt.text = ntext;_
_ txt.selectable = false;_

I searched all the forum for the solutions but still have no luck!
Thanks in advanced!

What’s wrong with the image, exactly? Is the “H” supposed to be bigger, or is something else wrong?

[Solved] [Solved] Lib.getURL does not work!

@minh-nguyen the fix isn’t to use the openfl-legacy in your project.xml, that just sets OpenFL to use Legacy instead of Next.

The text issue itself is probably the same that I experienced, and that has been fixed in development: https://github.com/openfl/lime/commit/4b5ea217ba978db020ccb2e3abb3b8b1943aa4d5

So it will be out in the next OpenFL release, and that should fix the issue when you’re using OpenFL Next.

Confirmed :slight_smile: Adding openfl-legacy to project.xml, the width and the height of characters can be displayed well but when testing carefully on devices, text does not show up especially when setting the font size more bigger. Hopefully, it can be solved in the next version of OpenFL!