* src/FontScale.py: try to handle non-ASCII characters
svn: r2127
This commit is contained in:
parent
66f96ee4d8
commit
d6a6db0865
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user