@@ -2345,6 +2345,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
2345
2345
return self .draw_mathtext (gc , x , y , s , prop , angle )
2346
2346
2347
2347
fontsize = prop .get_size_in_points ()
2348
+ language = mtext .get_language () if mtext is not None else None
2348
2349
2349
2350
if mpl .rcParams ['pdf.use14corefonts' ]:
2350
2351
font = self ._get_font_afm (prop )
@@ -2355,7 +2356,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
2355
2356
fonttype = mpl .rcParams ['pdf.fonttype' ]
2356
2357
2357
2358
if gc .get_url () is not None :
2358
- font .set_text (s )
2359
+ font .set_text (s , language = language )
2359
2360
width , height = font .get_width_height ()
2360
2361
self .file ._annotations [- 1 ][1 ].append (_get_link_annotation (
2361
2362
gc , x , y , width / 64 , height / 64 , angle ))
@@ -2389,7 +2390,8 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
2389
2390
multibyte_glyphs = []
2390
2391
prev_was_multibyte = True
2391
2392
prev_font = font
2392
- for item in _text_helpers .layout (s , font , kern_mode = Kerning .UNFITTED ):
2393
+ for item in _text_helpers .layout (s , font , language = language ,
2394
+ kern_mode = Kerning .UNFITTED ):
2393
2395
if _font_supports_glyph (fonttype , ord (item .char )):
2394
2396
if prev_was_multibyte or item .ft_object != prev_font :
2395
2397
singlebyte_chunks .append ((item .ft_object , item .x , []))
0 commit comments