Lemur and Chinese Characters

Is there a good way to display Chinese characters with Lemur? I have an interested party to translate my games content to Chinese. Just wondered to what I might say yes :smiley:

Ideas?

I think people have done it before.

Lemur just uses JMEā€™s BitmapText. So as long as you have an .fnt with all of the glyphs defined then it should work. (It will be a big font with lots of files, I think.)

Edit: note that others have also written TTF font support which generates the bitmap images at runtime based on text used. I donā€™t know much about them, though, other than they exist.

1 Like

Here is one of the available TTF font libraries:

Hereā€™s one for freetype font. I donā€™t know if it is intended for public use yet.

4 Likes

This freetype font support for jme3 has some problems, it wants to load libgdx.dll instead of the existing libgdx64.dll. So I implemented a simple ttf to bitmap and rendered an atlas for all chinese fonts I could get a hand on (23ā€™000 I think) on a big atlas (10240 x 10240) which worked at least with my graphic card, but I will probably make my bitmap renderer a bit smarter and only render the chinese symbols I need for my game and that will be for sure less than what I have. Also I will try to get my head around that paging of this bitmap font atlas.
I have now another question, how would you guys operate when you have for example a credits screen, which will then have mixed latin and chinese (all the ppl so far do not have chinese symbols in their names only latin characters)?

Each line of the credit screen could be a different label with its own font.

1 Like

In case you didnā€™t already know.

Here is the orignal BMFont tool:
https://www.angelcode.com/products/bmfont/

Here is Hiero which can do the same thing:

I always kind of end up back at BMFont for various reasons but its UI is kind of confusing. Iā€™m not sure what either of them would do with a Chinese font, though. With BMFont you can at least exactly control what characters are used.

1 Like

So I would check if there is a character with latin or chinese (chinese are somewhere above \u3400) ok, I can do this.

Users are not submitting their own text, right? You have to add it somewhereā€¦ when you add it then you will have to use the appropriate font.

Even for regular text in any application, a fully fleshed out TTF font with all languages is enormous. So usually something has to be done to pick an appropriate font for the language.

1 Like

Yes the UI is a bit confusing of BMFont. Atm I have my own solution (just smashed something together) bc I thought it will give me more control, but maybe BMFont is better. Other engines have ttf support in some sort or way I guess and it is maybe coming for JME to at some point? Anyway the bitmap are atm good enough for me.

Those two sentences go together to explain why the engine does not have TTF support.

ā€œWhy does this not have TTF support?ā€

ā€œI guess bitmap font is ok for me right now.ā€

ā€¦and the person (asking the question) who would have written it that day moves onto something else.

1 Like

Well it is a en.yaml, de.yaml, schinese.yaml where I have my translations. When I just use i18n.getText(ā€œkey_of_the_translated_thingā€) and letā€™s say the schinese.yaml does have Latin, I will need a way to detect that. Buuut, I could also scan my yaml and see what characters it uses and then genrate the font for that (and then I can also mix it with Latin chars, even different fonts). So there are ways, I just thought there is a specific way you guys use for this or even an ā€œautomaticā€ way (like some magic, but I know it is most of the time not magic :wink: )

1 Like

Yeah exactly, maybe I should contribute something to JME and maybe I get some profound knowledge in this journey (I have know for controllers and wrote my own AppState for it and it works as I expected it to work but didnā€™t :smiley:). But it takes soooo much time to write a game that contribute to something is then so much on the top, I mean my solution is for my game, for the engine we would need some nice neat integration and generalization.
But yes absolutely as long I say it is good enough, nothing will change ā€¦

Hmmm yes I tried this first, but ended with a canā€™t loading libgdx.dll because I have libgdx64.dll, so I donā€™t know exactly where this went south it just didnā€™t work and I couldnā€™t make it work, so I basically gave up. Also the Gradle lines found on this page didnā€™t work and created errors, I fiddled a bit but eventually gave upā€¦

this one here
implementation ā€œorg.lwjgl:lwjgl-freetype::natives-windows:3.3.2ā€

and I didnā€™t like the windows only approach I see here, I might be wrong, but it is probably not yet ready.

And as far I got it, it is also Bitmap in the end, just on the fly.

BMFont is completely sufficient if only used for UI display.

My purpose in developing that library is to support users input text.

2 Likes