Download

Support for Thai text in editor

I’m currently learning UE4. And in process, I’ve run accross the issue that the editor does not support Thai text properly. It basically displays 'Tofu’s in the field.

https://forums.unrealengine.com/filedata/fetch?filedataid=162328&type=thumb

After I’ve played around a little bit, I found that the renderer does support rendering Thai text in the field, but there is no Thai font ships with the engine. I can’t find a way to add fonts to the editor, I ended up replacing DroidSansFallback.ttf with font likes DroidSansThai.ttf (which would breaks other non-latin languages). The editor then displays Thai text properly.

https://forums.unrealengine.com/filedata/fetch?filedataid=162330&type=thumb

Since this is relatively easy to fix/add (I believe), I’d like to request to add Thai font to the editor. I think DroidSans Thai (from Google) might be a good fit, as other Droid fonts are already in-use in the engine.

1 Like

After a few months, I decided to dig a little more into the UE4’s code.

Basically just adding a few fonts file into LegacySlateFontInfoCache.cpp and the editor will display some Thai text. It’s not perfect yet, but I think it looks good enough.

The font I use for this screenshot is Sarabunfrom Cadsondemak. It’s a variant of TH-Sarabun PSK, released under OFL terms.

I am actually interested to send in a PR for this change, however since font files are not parts of the source file hosted on GitHub, I can’t just send one and hope that it will work correctly. So can someone suggest how and what should I do to get this one in?

1 Like