8000 Merge remote-tracking branch 'upstream/v1.3.x' · matplotlib/matplotlib@fe96a1d · GitHub
[go: up one dir, main page]

Skip to content

Commit fe96a1d

Browse files
committed
Merge remote-tracking branch 'upstream/v1.3.x'
Conflicts: doc/conf.py
2 parents 16ed8be + e4fc86f commit fe96a1d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

doc/conf.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,19 @@
3131
'matplotlib.sphinxext.plot_directive',
3232
'sphinx.ext.inheritance_diagram',
3333
'sphinxext.gen_gallery', 'sphinxext.gen_rst',
34-
'matplotlib.sphinxext.ipython_console_highlighting',
3534
'sphinxext.github',
3635
'numpydoc']
3736

37+
38+
# Use IPython's console highlighting by default
39+
try:
40+
from IPython.sphinxext import ipython_console_highlighting
41+
except ImportError:
42+
extensions.append('matplotlib.sphinxext.ipython_console_highlighting')
43+
else:
44+
print("Using IPython's ipython_console_highlighting directive")
45+
extensions.append('IPython.sphinxext.ipython_console_highlighting')
46+
3847
try:
3948
import numpydoc
4049
except ImportError:

lib/matplotlib/backends/backend_pdf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,9 @@ def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
18121812
dvifont=dvifont)
18131813
seq += [['font', pdfname, dvifont.size]]
18141814
oldfont = dvifont
1815-
seq += [['text', x1, y1, [chr(glyph)], x1+width]]
1815+
# We need to convert the glyph numbers to bytes, and the easiest
1816+
# way to do this on both Python 2 and 3 is .encode('latin-1')
1817+
seq += [['text', x1, y1, [chr(glyph).encode('latin-1')], x1+width]]
18161818

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

0 commit comments

Comments
 (0)
0