Hi! I have a problem displaying the Thai language in my game.
I’m using a Thai font and if I check the Glyph Table, it has all the characters I use. But when I write a text in Unity (I’m using TMProUGUI but it’s the same with Text), some Diacritical Marks don’t appear.
The latest release of the TextMesh Pro package (version 3.2.0-pre.3) includes support for Diacritical Marks. However, this data needs to be manually populated until the functionality to extract this data from the GPOS table at runtime lands in some new future version of Unity.
P.S. Support for OpenType Layout features is what I have been and continue to be working on. I am hoping to have this available in Unity 2020.3 or newer within the next 60 - 90 or less.
Thanks for the quick reply!
So, how can I do to manually populate the functionality? I’m still learning about Unity and this is my first trying a a multilingual game, can you guide me?
Hello Stephan! Is there any update on when the OpenType Layout features will make it into Unity?
In the meantime, can you offer some instructions for how to manually populate the layout data so that Indic scripts such as Thai are rendered properly? For reference, here is a good post explaining the issue we currently face in Thai (general summary: some vowels and tone marker diacritics need to change their position slightly depending on what’s underneath them).
It looks like the code couldn’t find specific TH glyp from the character look up table.
By the way, this hack is not required anymore in unity 2021.3.16f1 + TMP 3.2 preview 4 because new version of Unity and TMP have the ability to extract kerning data directly out of the font so if you’re on newer version just use the official way of doing it and export the TMP font back to your older project (I’m not sure if this is going to work though, but it’s worth a try)
Hi everyone, I’ve developed an open-source solution for resolving Thai vowel and tone mark issues, called Thai Text Care for Unity. It also supports fast word segmentation using a Thai dictionary.
The library utilizes TextMeshPro’s Glyph Pair Adjument feature to automate adjustments to glyph pairs based on predefined Glyph Combinations.
When you set a Glyph Combination, you specify which Thai character glyphs should pair together and the appropriate offset for each pair. ThaiFontDoctor then updates the GlyphAdjustmentTable in your TMP_FontAsset in real-time, making it easy to fine-tune how vowels and tone marks appear in your TMP_Text components.