4

目前我们需要在游戏中显示泰语,使用 cocos2dx 2.x 游戏引擎。
但是有些字体没有正确显示。

原文:
ยินดีต้อนรับสู่{p0} ขอให้ท่านเล่นเกมให้สนุก</p>

在 vscode 中显示(在 vscode 中正确):
在此处输入图像描述

在 sublime 3 中显示(在 sublime 3 中显示错误,所有标点符号都显示错误): 在此处输入图像描述 在此处输入图像描述

在我们的游戏中显示(部分标点符号显示错误):
在此处输入图像描述
在此处输入图像描述

即使 vscode 和 sublime 3 中的 fontFamily 设置相同,结果也相同。
这是什么原因?我该如何解决?

4

1 回答 1

2

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.

于 2017-09-08T03:21:24.680 回答