* src/FontScale.py: try to handle non-ASCII characters

svn: r2127
This commit is contained in:
Don Allingham 2003-09-15 02:42:40 +00:00
parent 66f96ee4d8
commit d6a6db0865

View File

@ -256,5 +256,8 @@ def string_width(font,text):
l = _font_array[i][j]
r = 0
for c in text:
r = r + l[ord(c)]
try:
r = r + l[ord(c)]
except:
r = r + l[ord('n')]
return (r+1)*s