public virtual int GetWidth(string text)
{
int total = 0;
if (fastWinansi) {
int len = text.Length;
for (int k = 0; k < len; ++k) {
char char1 = text[k];
if (char1 < 128 || (char1 >= 160 && char1 <= 255))
total += widths[char1];
else
total += widths[PdfEncodings.winansi[char1]];
}
return total;
}
else {
byte[] mbytes = ConvertToBytes(text);
for (int k = 0; k < mbytes.Length; ++k)
total += widths[0xff & mbytes[k]];
}
return total;
}