@@ -1465,7 +1465,7 @@ def draw_tex(self, gc, x, y, s, prop, angle):
14651465 self .draw_path (boxgc , path , mytrans , gc ._rgb )
14661466
14671467 def encode_string (self , s , fonttype ):
1468- if fonttype == 3 :
1468+ if fonttype in ( 1 , 3 ) :
14691469 return s .encode ('cp1252' , 'replace' )
14701470 return s .encode ('utf-16be' , 'replace' )
14711471
@@ -1492,7 +1492,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False):
14921492 font = self ._get_font_afm (prop )
14931493 l , b , w , h = font .get_str_bbox (s )
14941494 descent = - b * fontsize / 1000
1495- fonttype = 42
1495+ fonttype = 1
14961496 else :
14971497 font = self ._get_font_ttf (prop )
14981498 self .track_characters (font , s )
@@ -1627,9 +1627,9 @@ def get_text_width_height_descent(self, s, prop, ismath):
16271627 font = self ._get_font_afm (prop )
16281628 l , b , w , h , d = font .get_str_bbox_and_descent (s )
16291629 scale = prop .get_size_in_points ()
1630- w *= scale
1631- h *= scale
1632- d *= scale
1630+ w *= scale / 1000
1631+ h *= scale / 1000
1632+ d *= scale / 1000
16331633 else :
16341634 font = self ._get_font_ttf (prop )
16351635 font .set_text (s , 0.0 , flags = LOAD_NO_HINTING )
0 commit comments