diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2009-07-18 00:40:59 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2009-07-18 00:40:59 (GMT) |
commit | 19d464d591f664ebce4472f706d6c01a5774501c (patch) | |
tree | 336431ce0ef3d7c02882420eaa32601f0f90c7cc /taturtle.py | |
parent | 35137c3856627a752e6d4ae4d5248bf79e22e557 (diff) |
dead key workaround
Diffstat (limited to 'taturtle.py')
-rw-r--r-- | taturtle.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/taturtle.py b/taturtle.py index 39f4570..9479c97 100644 --- a/taturtle.py +++ b/taturtle.py @@ -252,12 +252,15 @@ def draw_text(t, label, x, y, size, w): fd.set_size(int(size)*pango.SCALE) except: pass - pl = t.tw.window.create_pango_layout(str(label)) - pl.set_font_description(fd) - pl.set_width(int(w)*pango.SCALE) - t.canvas.image.draw_layout(t.gc,int(x),int(y),pl) - w,h = pl.get_pixel_size() - invalt(t,x,y,w,h) + if type(label) == str or type(label) == unicode: + pl = t.tw.window.create_pango_layout(label.replace("\0"," ")) + pl.set_font_description(fd) + pl.set_width(int(w)*pango.SCALE) + t.canvas.image.draw_layout(t.gc,int(x),int(y),pl) + w,h = pl.get_pixel_size() + invalt(t,x,y,w,h) + else: + print type(label) def draw_line(t,x1,y1,x2,y2): x1,y1 = t.width/2+int(x1), t.height/2-int(y1) |