View Issue Details

IDProjectCategoryView StatusLast Update
0009745New issuesClientpublic2017-10-20 21:40
ReporterthisdpAssigned Toccw 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Summary0009745: dxGetTextWidth returns wrong width of text
Description

dxGetTextWidth doesn't work well with utf8 chars.

Steps To Reproduce

This works fine:
local width1 = dxGetTextWidth("a")
local width2 = dxGetTextWidth(" ")
local combined = dxGetTextWidth("a ")
if width1+width2 == combined then
outputChatBox("fine")
else
outputChatBox("Wrong! width1="..(width1)..";width2="..(width2)..";combined="..combined)
end
But this has problem:
local width1 = dxGetTextWidth("我")
local width2 = dxGetTextWidth(" ")
local combined = dxGetTextWidth("我 ")
if width1+width2 == combined then
outputChatBox("fine")
else
outputChatBox("Wrong! width1="..(width1)..";width2="..(width2)..";combined="..combined)
end

TagsNo tags attached.

Issue History

Date Modified Username Field Change