The game-making system Godot Engine is interesting, and has caught my eye. I’m interested in creating games for English and Japanese markets, so non-Latin character support is a must for me. The system appears to support Latin by default. The current docs for setting up and working with non-Latin characters is a bit scant, so here’s some of my findings.
I opened an existing scene, and the editor interface appears as follows:
As an exercise, let’s see what happens when Japanese text is entered. First, let’s setup a regular label in English:
Hello is entered into the text property:
Switch over to Japanese text-entry, and enter some text. Godot doesn’t support the native IME, so the entered text will appear in the top-left corner:
Press enter to select the kanji. This would normally update the text where the cursor was (i.e. text property):
But you end up with a blank property:
Actually the text is there, it’s just invisible due to the default Latin font being applied as the global font.
Let’s overcome the issue. First go to Google’s Noto fonts, and click on the highlighted link (for CJK fonts). Noto fonts is a collection of the world’s languages represented by the same font, and expressed in unicode. If you are seeking a different language to Japanese, you can find an alternative language by using the interactive map to select your specific language font. The Godot process below will then be the same for your specific language.
Here’s the Google Noto font page:
It’s important to locate and download the precise font you need. In my case, I could locate a convenient folder containing all the CJK fonts broken down into language and font weights. The link for that folder is shown below (highlighted):
Here’s the folder listing, and I’ve indicated some font groups. The highlighted link was the particular Japanese font I chose.
Upon downloading, I moved it to the same folder as Godot:
Next, import the font. This is necessary to convert to the required .fnt format:
Specify the font (indicated by (1) below):
Locate the folder, and select the previously-downloaded font and click Open:
Specify the font name including the .fnt (1). It’s possible to type the new font name directly (make sure to specify the extension .fnt). I used the same name as the original. Then, (2) specify the charactet set (Unicode), and optionally specify a font size, then (3) click Import:
The converted font will appear in the resource folder for your scene (in my case folder ‘test’):
Then copy (not move) the converted font to the same folder as Godot. This is to ensure it will be available generally as a global font for the Godot environment.
Now return to Godot, and setup the global font. Go to Settings, then click Editor Settings, as indicated below:
Then specify the Global Font, by clicking the folder icon (1) and then File (2):
Specify the font in the Godot folder (1), and click Open (2):
You will then see the font path indicated below. Then you must close Godot and relaunch the application for the global font setting to take effect. Failure to do this, will render the following meaningless and create confusion.
Upon relaunch, you may notice a distinct change to the editor due to the new font. I personally quite like it.
So returning to Japanese entry. After reopening the scene, the Japanese text now appears in the property value:
But does not appear in the scene view (see below). The solution for this is to specify the same font we converted before, but accessing the Custom Fonts property and loading the font, as shown below:
Choose the font we converted originally, and left in the resource folder for this scene:
Upon returning to the scene, the proper character display can be seen in the scene.
I’ve yet to confirm how this appears on a mobile device, but I presume it will be ok since Godot uses bitmaps derived from fonts.