Eddy Lin
Eddy Lin

Reputation: 525

Thai fonts rendering

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?

Upvotes: 4

Views: 513

Answers (1)

Eddy Lin
Eddy Lin

Reputation: 525

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.

Upvotes: 2

Related Questions