* 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 fdea34896e
commit 7c847b176f

View File

@ -256,5 +256,8 @@ def string_width(font,text):
l = _font_array[i][j] l = _font_array[i][j]
r = 0 r = 0
for c in text: 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 return (r+1)*s