Getting Godot Engine to display Japanese

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:

gd-j-1

As an exercise, let’s see what happens when Japanese text is entered. First, let’s setup a regular label in English:

gd-j-2

Hello is entered into the text property:

gd-j-3

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:

gd-j-4

Press enter to select the kanji. This would normally update the text where the cursor was (i.e. text property):

gd-j-5

But you end up with a blank property:

gd-j-6

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:

gd-j-7gd-j-8

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):

gd-j-9

Here’s the folder listing, and I’ve indicated some font groups. The highlighted link was the particular Japanese font I chose.

gd-j-10

Upon downloading, I moved it to the same folder as Godot:

gd-j-11

Next, import the font. This is necessary to convert to the required .fnt format:

gd-j-12

Specify the font (indicated by (1) below):

gd-j-13

Locate the folder, and select the previously-downloaded font and click Open:

gd-j-14

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:

gd-j-15

The converted font will appear in the resource folder for your scene (in my case folder ‘test’):

gd-j-16

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.

gd-j-17

Now return to Godot, and setup the global font. Go to Settings, then click Editor Settings, as indicated below:

gd-j-18

Then specify the Global Font, by clicking the folder icon (1) and then File (2):

gd-j-19

Specify the font in the Godot folder (1), and click Open (2):

gd-j-20

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.

gd-j-21

Upon relaunch, you may notice a distinct change to the editor due to the new font. I personally quite like it.

gd-j-22

So returning to Japanese entry. After reopening the scene, the Japanese text now appears in the property value:

gd-j-23

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:

gd-j-24

Choose the font we converted originally, and left in the resource folder for this scene:

gd-j-25

Upon returning to the scene, the proper character display can be seen in the scene.

gd-j-26

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.

3 thoughts on “Getting Godot Engine to display Japanese

    • I just tried the method using the Noto simplified Chinese font (NotoSansSC-Medium) with the standard Pinyin IME and it was ok (on Windows 8.1). Hopefully it will work for you.

Leave a Reply

Your email address will not be published. Required fields are marked *