Quote:
Originally Posted by georgik57
How do I get the needed character width info? Looks like it would be the best option.
|
Manually define spacing for every character. Maybe something like this (could be improved to use a smaller array, but fine for an example):
PHP Code:
new Float:CharSpace[1024];
SetupCharSpace()
{
CharSpace['0'] = 0.8;
CharSpace['1'] = 0.4;
CharSpace['W'] = 1.2;
// Etc.
}
CountStringSpacesEquivalent(const str[])
{
new Float:space;
for (new i, len = strlen(str), c; i < len; i++)
{
c = str[i];
space += CharSpace[c];
}
return floatround(space);
}
__________________