And today here we come at Godot Engine. Godot Engine is an open source game engine which gains more and more popularity among game developers. Part of the reason is it’s an open source, another part would be it is good enough for many indie games.
When it comes to Thai in Godot Engine, one of the pioneers is LeftWay from Tongson. Tongson is actually a friend of mine whom I chat with almost everyday. He is quite onto Open Source and discovered Godot very early on. He is even one of the first developer who publish games made with Godot in Steam. And that’s a shoutout to him, mavhod.
Enough with the introduction.
Godot Engine supports two kinds of font, the bitmap fonts, and dynamic fonts. Dynamic fonts is in fact TrueType fonts, backed by FreeType library.
First of all, bitmap fonts does not work with Thai, period. Just skip it.
Regarding Dynamic Fonts. Since FreeType has advanced layout feature removed when it was transitioned to the version 2, you can assume that necessary feature for Thai text is also removed as well. I have no experiences with FreeType 1, but FreeType 2 does not supports those features. That also the reason why Dynamic Fonts does not support these features as well.
So yes, its support for Thai text is pretty much on par with Unity 3D. No
mark supports. For the time being, you’ll be stuck with older fonts, designed a decade ago. I won’t go into details for now, but it’s pretty similar to Unity 3D version I made. Please check it out.
And here it plays out in-game:
As you might have guess, if you read the link I’ve mentioned before, the above text is Loma from TLWG, and below is Sarabun from Cadsondemak. Loma is older font, which was designed at the time there were no OpenType, so the designer took extra care to make sure it is read-able when the combination of character can lead into problem. These design decision is not present with Sarabun, which was designed much later. Comparing the output of these two fonts, you might notice the missing ticks on Sarabun, and also the tail of one character is overlapping the tail of the above vowel character. That’s the trait of newer fonts.
Similar to Unity3D, you can also do glyph substitution technique to solve the floating tonemark and the floating vowel problem. The feature image I took from LeftWay shows the in-house implementation made by the developer. Please scroll up a little bit :).
However, after I do some more investigation, I come up with the conclusion that it will be come a waste of time in the near feature.
Someone in the Godot Engine community has already proposed to do OpenType shaping based on Harfbuzz library. In fact, a pull request is already been reviewed and should be merged to the main trunk very very soon. The PR originated by a needs to do LTR text layout which is required by Arabian language, but we are also benefitted from the PR as well (they even have screenshots contains Thai text as well). I’d like to express my gratitude to the user bruvzg on github. Thank you.
Here’s the test screenshot, taken directly from that PR. Credit to bruvzg as well.
I’m expecting this to be merged into the next major release of their, but well don’t hold your breath.
The game engine’s editor runs on top of the game engine, like Unreal Engine 4. So since the engine could not display Thai perfectly (yet), then the editor also suffer from the same problem.
Anyway, Godot ships with Thai font, NotoSansThaiUI, so at least it can display Thai (unlike UE4). And since they ship with older version of NotoSansThaiUI, the font has older design that based on the constraints we had in the past. Thus, Godot Engine can display Thai text pretty well.
So, out of the box, Godot has one of the best Thai support.
Here’s the font I uses in above example.
- Sarabun designed by Cadsondemak based on TH-Sarabun PSK by Suppakit Chalermlarp, released by Google under Open Font License (OFL).
- Loma, by Thai Linux Working Group, released under GPLv2 with font exception.
Feature Image taken from LeftWay by Tongsun. I’m not associated nor affiliated with the company nor the title in anyway.
C++ Programmer and Music Advocate.