Thai fonts rendering

454 views Asked by At

Currently we need to display thai in our game, which use cocos2dx 2.x game engine.
But some fonts are not correctly displayed.

Original text:
ยินดีต้อนรับสู่{p0} ขอให้ท่านเล่นเกมให้สนุก

Displayed in vs code(correct in vscode):
enter image description here

Displayed in sublime 3(wrong in sublime 3, all punctuation marks are wrongly displayed): enter image description here enter image description here

Displayed in our game(some punctuation marks are wrongly displayed):
enter image description here
enter image description here

Same result even fontFamily setting in vscode and sublime 3 are same.
What's the reason of this? How can I solve it?

1

There are 1 answers

0
Eddy Lin On

After some researches, I have solved this problem in our game.
Actually, each of these punctuations is a single character in Unicode.
enter image description here
But they need to be combined with other characters, which means their widths is zero.
I guess sublime 3 haven't handled this logic in rendering texts yet.
For our game, I set the widths of these special characters to zero, and it works fine now.