Category: Tools
Unity Text Rendering Issue
Recently I have planned for a Telugu word game in unity and i have noticed that Unity text rendering system doesn’t work for some languages(Hindi, Telugu, Tamil etc..). The text looks broken, wrong order of alphabets and missing shapes etc…
Look into below image for better understanding.
This happens because unity doesn’t read/apply glyph positions (GPOS) and glyph substitutes (GSUB) from font file.
GPOS and GSUB tables information is necessary for these languages to render text properly.
I have searched for a solution, but i couldn’t find anything, So i thought to solve myself and tried some ideas.
Idea 1:
Create a native plugin to read GPOS and GSUB tables from font files.
Create a custom Text component and uni scribe text as per language rules
Apply GPOS and GSUB information and generate text mesh .
Pros: I can use downloaded TTF fonts, No need to create font asset.
Cons: Creating a native plugin is platform dependent. I have to write for all platforms.
Idea 2:
Create a custom font asset inside unity.
Design font from scratch using sprites and store alphabet information in font asset.
Create a custom Text component and uni scribe text as per language rules.
Read alphabets information from custom font asset and generate text mesh.
This idea is platform independent, But have to design font asset.
I followed the Idea no 2 and prepared flow charts
Click on the image to see full size.
Download Sample Telugu and Tamil Font:
Issue Tracker: https://bitbucket.org/yakkalatech/tindictext/issues
Here is the output.
“https://youtu.be/KnTtBFrI3d0”
There might be a better and easy solution for this issue, but for now this is the only idea i have. So i am using this for my upcoming game.