Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 21eb328

Browse files
committed
Bugfixes in pdf usetex
svn path=/trunk/matplotlib/; revision=3828
1 parent 63c74ad commit 21eb328

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

lib/matplotlib/backends/backend_pdf.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,12 +519,13 @@ def embedType1(self, filename, fontinfo):
519519
ul_position, ul_thickness = font.get_ps_font_info()
520520

521521
if fontinfo.encodingfile is not None:
522-
differencesArray = [ Name(ch) for ch in
523-
dviread.Encoding(fontinfo.encodingfile) ]
522+
enc = dviread.Encoding(fontinfo.encodingfile)
523+
widths = [ afmdata.get_width_from_char_name(ch)
524+
for ch in enc ]
525+
differencesArray = [ Name(ch) for ch in enc ]
524526
differencesArray = [ 0 ] + differencesArray
525527
firstchar = 0
526528
lastchar = len(differencesArray) - 2
527-
widths = [ 100 for x in range(firstchar,lastchar+1) ] # XXX TODO
528529
else:
529530
widths = [ None for i in range(256) ]
530531
for ch in range(256):
@@ -1427,7 +1428,7 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
14271428
# Pop off the global transformation
14281429
self.file.output(Op.grestore)
14291430

1430-
def draw_tex(self, gc, x, y, s, prop, angle):
1431+
def _draw_tex(self, gc, x, y, s, prop, angle):
14311432
# Rename to draw_tex to enable
14321433

14331434
texmanager = self.get_texmanager()

0 commit comments

Comments
 (0)