@@ -49,8 +49,6 @@ def _nums_to_str(*args):
4949
5050def quote_ps_string (s ):
5151 "Quote dangerous characters of S for use in a PostScript string constant."
52- if isinstance (s , unicode ):
53- s = s .encode ('ascii' , 'replace' ) # unicode not supported yet
5452 s = s .replace ("\\ " , "\\ \\ " )
5553 s = s .replace ("(" , "\\ (" )
5654 s = s .replace (")" , "\\ )" )
@@ -408,9 +406,6 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath):
408406 """
409407 # local to avoid repeated attribute lookups
410408
411- if isinstance (s , unicode ):
412- self .draw_unicode (gc , x , y , s , prop , angle )
413- return
414409
415410 write = self ._pswriter .write
416411 if debugPS :
@@ -451,10 +446,12 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath):
451446 """ % locals ()
452447 self ._draw_ps (ps , gc , None )
453448
454- else :
455- if ismath :
456- return self .draw_mathtext (gc , x , y , s , prop , angle )
449+ elif ismath :
450+ return self .draw_mathtext (gc , x , y , s , prop , angle )
457451
452+ elif isinstance (s , unicode ):
453+ return self .draw_unicode (gc , x , y , s , prop , angle )
454+ else :
458455 font = self ._get_font_ttf (prop )
459456 font .set_text (s ,0 )
460457
0 commit comments