From d6a6db08659734af0134229422a3ca6e69644cfc Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 15 Sep 2003 02:42:40 +0000 Subject: [PATCH] * src/FontScale.py: try to handle non-ASCII characters svn: r2127 --- src/FontScale.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/FontScale.py b/src/FontScale.py index b6de44cdd..c7cdbe409 100644 --- a/src/FontScale.py +++ b/src/FontScale.py @@ -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