- Joined
- Jan 23, 2015
- Messages
- 124
So, I was going to fix StringSize ([Snippet] StringSize - Blizzard Modding Information Center) this evening because it shows really bad results in my case for myself (width of "1" for example, is about 2 times smaller than it should), made a test script and started to work... but I noticed weird thing: in log and in game there were different widths for one kind of symbols.
Initially I need it for my multiboard, and since I guess it would have different text size from both game and logs... Uh. It seems there's no real way to get the string width without just huge amount of manual work including considering each type of string usage, right?
JASS:
scope MyScope initializer onInit
globals
integer s
endglobals
private function callback takes nothing returns nothing
local string l = Ascii2Char(s)
local real i= 450 / StringSize.measureChar(l)
local integer a = R2I(i)
local string str = ""
loop
exitwhen a < 1.0
set str = str + l
set a = a - 1
endloop
call BJDebugMsg(str + "-|" + R2S(i) + " " + I2S(s))
set s = s + 1
endfunction
private function onInit takes nothing returns nothing
set s = 32
call TimerStart(CreateTimer(), 1.0, true, function callback)
endfunction
endscope
In-game
Log
The "-|" shows relative width of string, so as you can see it has really different relations with each other
Log
The "-|" shows relative width of string, so as you can see it has really different relations with each other
Last edited: