Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 38d846b

Browse filesBrowse files
committed
Fix #2636: Non-ascii characters coming from TeX are wrong
1 parent a0bb747 commit 38d846b
Copy full SHA for 38d846b

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎lib/matplotlib/backends/backend_pdf.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_pdf.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,9 @@ def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
17451745
dvifont=dvifont)
17461746
seq += [['font', pdfname, dvifont.size]]
17471747
oldfont = dvifont
1748-
seq += [['text', x1, y1, [chr(glyph)], x1+width]]
1748+
# We need to convert the glyph numbers to bytes, and the easiest
1749+
# way to do this on both Python 2 and 3 is .encode('latin-1')
1750+
seq += [['text', x1, y1, [chr(glyph).encode('latin-1')], x1+width]]
17491751

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.