[SOLVED] Display japanese font on Android target
-
Hi, I made a game using HaxeFlixel some years ago, where a few japanese characters were displayed on the screen. It was working for both Flash and Android targets, and it was as simple as:
var txt:FlxText = new FlxText(0, 50, FlxG.width); txt.setFormat(AssetPaths.EPSON_GYOSHO_lite__ttf, 25, 0xff000000, "center"); txt.text = "連珠"; add(txt);
I dug up the source code a few days ago to give it a fresh, so I installed the latest versions of haxe/flixel/etc... And now the japanese fonts only shows up on Flash target. I already tried a few things using UnicodeString without results. And the help page https://haxe.org/manual/std-UnicodeString.html is down.
What should I do in order to display my characters on Android?
Thanks for our help.
-
Following the reading of this Haxe blog post (https://haxe.org/blog/unicode/), I tried those two lines without success:
txt.text = "" + Bytes.ofString("連珠", UTF8);
and
txt.text = "" + Bytes.ofString("連珠", RawNative);
I also tried that: https://api.haxe.org/v/development/UnicodeString.html
"Available on all platforms. This abstract provides consistent cross-target unicode support."txt.text = new UnicodeString("連珠");
As always, all those tests are working perfectly under "burn the witch" Flash, but not under Android... What am I doing wrong?
-
Could be the same issue as https://github.com/openfl/openfl/issues/2264 (
FlxText
uses an OpenFLTextField
under the hood).
-
Just so you know, the problem comes from OpenFL file: openfl/src/openfl/_internal/text/TextLayout.hx
Reverting to b151041 resolves the problem on Android, but apparently, it breaks the Windows c++ build.