Skip to content

Commit a00196b

Browse files
committed
Fix cyrillic characters coming from LaTeX, saving in PDF
1 parent a6a09c1 commit a00196b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_pdf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,8 @@ def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
18221822
oldfont = dvifont
18231823
# We need to convert the glyph numbers to bytes, and the easiest
18241824
# way to do this on both Python 2 and 3 is .encode('latin-1')
1825-
seq += [['text', x1, y1, [chr(glyph).encode('latin-1')], x1+width]]
1825+
seq += [['text', x1, y1,
1826+
[six.unichr(glyph).encode('latin-1')], x1+width]]
18261827

18271828
# Find consecutive text strings with constant y coordinate and
18281829
# combine into a sequence of strings and kerns, or just one

0 commit comments

Comments
 (0)