How to add support for glyph heavy languages (Chinese, Japanese, Korean etc)

Teddy

Developer
Staff member
Warning: Languages with complex layout rules won't work with XNA's spritefonts at all! Two examples of this is Thai (can't render compound characters) and Arabic (the text is left-to-right and not tied together). Miraculously Korean is possible to make sprite fonts of despite its layout rules, since every syllable is a unique unicode entry.

Why is this necessary?

Because XNA uses spritefonts, and spritefonts suck. Some written languages, like Chinese, Korean and Japanese, consists of a huge amount of glyphs. This becomes a problem in sprite font based rendering, because a single sprite font can't hold all thousands upon thousands of glyphs (at least not the XNA spritefont).

The solution for this is to create custom spritefonts using only the characters present in the translation.

Normally only a small fraction is used when translating, and it's possible to create spritefonts if the number of symbols aren't sky high. I don't know the actual number, but 1000 glyphs should be no problem, for example.

I've provided some tools that should help with both calculating the glyphs used, as well as creating the sprite fonts. All these tools have been included in the Fonts Tab inside the Translation Suite.

The biggest hurdle is probably installing the prerequisites for building XNA assets, which you'll need to do. You'll never actually use any of these programs, but the simple Content Builder provided in the translation suite will use parts of them to create the fonts.

First, you'll need any version of Visual Studio, so if you don't have one installed just download the free community version.

Then you must install the XNA Game Studio stuff. Since the old installer doesn't work well with newer machines, follow steps 1-3 in this guide. You can stop at step 4 since we're not actually going to use Visual Studio for anything!

The Fonts Tab:

main_05fontstab.png

1) These buttons lead to the same links you see above, letting you download the installers for Visual Studio and XNA Game Studio
2) The font name of your font, if you have one you think will be better (it's actually super hard finding fonts that work well at small sizes, but feel free to try, and please share if you find a great, open font)
3) This is the keyword for the font inside the game, also known as subfont! You can see what subfont a specific string in the Misc Text Translator. All strings with that subfont will look the same.
4) Here you can adjust certain things about the font, like changing its size, spacing and making it bold
5) These buttons will do all the tedious work for you after you're done with the settings

In order to make the game render your translation, you must compile every font in the list. This will make the game render text with that font if there's a translation available for it.

All non-translated texts will render with the default English font, so you don't need to worry about that.

To create a custom font for your translation, first press Compile Regions, then Create Spritefont, and last Compile Spritefont. This should open up a separate program that will hopefully manage to compile your new font! After the fonts are compiled, you should be able to open up the Dialogue and Misc Text tools again and have the translation being rendered correctly using the game engine.

Don't hesitate to reply to this post if you're having trouble with this, as it's pretty complicated.
 
Last edited:

zesty

Green Slime
Is that the only way to get it working? Is there another program that might work win 8?
I have no idea, my friend helped me compiled the fonts we needed and he's using Windows 7. I suggest you to give compatibility mode a try, or just install multiple systems on your PC would be also fine.
 

TsReaper

Boar
Hello Teddy,
I'm a Simplified Chinese translator and this is a really handy tool. But I have some problems, can you help me?

1. I translated the description of Bloomo into Chinese and it looks like this.
problem1.png
I tried to click the down arrow key to move the scroll bar but it didn't work.

2. I translated the name of Green Slime into Chinese and it performs correctly in the menu.
problem2-1.png
But the hp bars didn't show it's name correctly.
problem2-2.png

3.
problem3.png
Does it mean that I can't translate NPC names into Chinese?

Looking forward to your reply.
 

Teddy

Developer
Staff member
Hey @TsReaper! Awesome to see you're doing a translation!

1) How weird! It might be that the code measures the English text instead of the translated one. I'll have to look into that one!

2) Oh, that's pretty bad. Hmm. They use different fonts, and the hp bar is very size restricted! I'll talk to Vilya about creating an alternate name bar that can scale to fit bigger fonts. I definitely aim to fix that!

3) Usually when the "No Subfont" message appears, it's because the designated space for that text is so small that any complex font can't be rendered. Certain parts of the menu is like that as well, for example the Inventory categories. It's an unfortunate oversight on our part, but not one that's easily fixed!

The NPC names specifically can be fixed if the name tag gets the ability to resize, of course! I might do that at some point. In most translations the NPC names aren't translated, but I can see why it would be preferred when translating to such a visually different language as Chinese.
 

Teddy

Developer
Staff member
How does the game handle dropped items, by the way? Does it render the text correctly in the bottom left, or will translated item names also get a lot of question marks?
 

The G-Meister

Giga Slime
Looks like they're using the same size font, apart from one has an outline. Might be able to kill to birds with one stone there Teddy!
 

TsReaper

Boar
And maybe the same problem...

problem1.png
(The Chinese characters means 1PHighscore, and the question marks are the Chinese translation of "Global".)

problem2.png
(The question marks are the Chinese translation of "No friend is playing Secrets of Grindea".)

And...When I choose Mt. Bloom in the dialogue translate tool, the tool just close without any hints.
 
Last edited:

Teddy

Developer
Staff member
Keep the reports coming! I'll sit down and try to fix all of these when things have calmed down a bit around here!

And...When I choose Mt. Bloom in the dialogue translate tool, the tool just close without any hints.

Does this happen to you @KoBeWi ?
 

Teddy

Developer
Staff member
And...When I choose Mt. Bloom in the dialogue translate tool, the tool just close without any hints.

Ah, I suspect I know what the issue was! I've updated the dialogue tool to include the new characters of Mt Bloom!

Could you try opening it again?
 

TsReaper

Boar
This time I can choose Mt. Bloom now. But when I choose Carter01/02, Steve_PreQuest01/01b/02, Steve_DuringQuest01/02 in Mt. Bloom, the tool crashes without hints again.
 

Teddy

Developer
Staff member
This time I can choose Mt. Bloom now. But when I choose Carter01/02, Steve_PreQuest01/01b/02, Steve_DuringQuest01/02 in Mt. Bloom, the tool crashes without hints again.

Man, this update sure had its share of tool errors!

I messed up the portrait bindings on Steve and Carter - I updated with a new version that should (hopefully?!) fix everything!
 

TsReaper

Boar
When you get a new card, the card description in the get-new-card animation will turn into question marks too.
 

Teddy

Developer
Staff member
Can you upload your translation project in a .zip file? (It can be found in Documents/Secrets of Grindea/Languages)

That way I can test these things with actual translations!
 
Top