Hi, Tasharen.I recently upgrade my project from v3.9.8 to v3.11.2, and run into a Label SpacingX problem which I have fixed in v3.9.8. The problem in v3.9.8 is, when you input some Thai characters like "ยืนยัน" in a label, set Overflow to Resize Freely,and the label's SpacingX to 1,then it shows like:
ยืนยั
น
I tried to modify v3.9.8 NGUIText.cs at line 1610:
Original:
// Advance the position
x += (subscriptMode == 0) ? finalSpacingX + glyph.advance :
(finalSpacingX + glyph.advance) * sizeShrinkage;
Modified:
//Modify NGUI by Qiulei [2017-3-9] : 解决泰语ยืนยัน在有spacingX时,显示错位的bug。原因:计算逻辑宽度时去掉了不占宽度的space,但绘制时没有去掉对应的space
float charWidth = GetGlyphWidth(ch, prev);
float realSpacingX = 0;
if (charWidth != 0f)
{
realSpacingX = finalSpacingX;
prev = ch;
}
// Advance the position
x += (subscriptMode == 0) ? realSpacingX + glyph.advance :
(realSpacingX + glyph.advance) * sizeShrinkage;
But when I try to find out if v3.11.2 has soved this issue, I got a headache
,the Label's SpacingX display is totally wrong:
If you want a Label show "abc" with Overflow Resize Freely,the SpacingX 10,it shows like:" abc" but not "a b c", apparently its a new bug.
I try to solve this by modifying v3.9.8 NGUIText.cs line 1015 and 1644."if (finalSpacingX < 0f) w += finalSpacingX;" to "w += finalSpacingX;",but it show " a b c " but not "a b c".
I don't want try to modify anything any more, and I hope you can solve this problem in next version
.
And hope Thai characters like "ยืนยัน" shows normally too