How can I use japanese characters in my BitmapText element?
BitmapFont guiFont = assetManager().loadFont("fonts/MSPGothic.fnt");
BitmapText hudText = new BitmapText(guiFont, false);
I know the MS PGothic contains japanese characters, but if I try to create fnt & png file with JMonkey SDK and load the asset in my application I get a java heap space exception.
Hmm, probably we should really stream them. Can you file a bug to https://github.com/jMonkeyEngine/sdk/issues? Also there was an option to create multiple pages, it might fix it.
Meanwhile you can use alternative tools. Any angel font tool will do. Such as Hiero etc.
If I use Hiero to export from MS PGothic to a fnt file then it works but the japanese characters are not shown. I’ve installed the japanese language pack.
I tried Hiero but without any success. How can I just export the japanese characters?
Well, we can focus on the SDK’s font tool. So it was successful on creating the font files? And only crashed when you tried to load these up? And was it your application that crashed or the SDK really? You can ramp up the memory limits on both.
What is also important is that you really use paging. To be on the safe side, you probably want to keep individual page 2048x2048 max. And was it that the SDK’s tool allows you to specify the character index from - to - range…
And If you could not make it through the export settings, alternatively, you may use Gimp or an online image editor to make the black area transparent.
BMFont is what I always use to make fonts locally. There are a lot of settings and it’s not always clear the effect they have but I’ve never had to load the images into another tool to fix them.
…I have loaded them into a tool to diagnose issues, though. So if you have a working font and a bad font, try loading them both into an image editor to see what’s wrong. And if both of them have similar transparency/coloring/etc. then maybe it’s something else wrong.