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

Skip to content

Commit dfc856a

Browse files
committed
Style changes.
1 parent 980fbee commit dfc856a

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,10 +1146,10 @@ def embedTTFType42(font, characters, descriptor):
11461146
# You are lost in a maze of TrueType tables, all different...
11471147
sfnt = font.get_sfnt()
11481148
try:
1149-
ps_name = sfnt[(1, 0, 0, 6)].decode('macroman') # Macintosh scheme
1149+
ps_name = sfnt[1, 0, 0, 6].decode('mac_roman') # Macintosh scheme
11501150
except KeyError:
11511151
# Microsoft scheme:
1152-
ps_name = sfnt[(3, 1, 0x0409, 6)].decode('utf-16be')
1152+
ps_name = sfnt[3, 1, 0x0409, 6].decode('utf-16be')
11531153
# (see freetype/ttnameid.h)
11541154
ps_name = ps_name.encode('ascii', 'replace')
11551155
ps_name = Name(ps_name)

lib/matplotlib/backends/backend_ps.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -696,10 +696,9 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
696696
self.set_color(*gc.get_rgb())
697697
sfnt = font.get_sfnt()
698698
try:
699-
ps_name = sfnt[(1,0,0,6)].decode('macroman')
699+
ps_name = sfnt[1, 0, 0, 6].decode('mac_roman')
700700
except KeyError:
701-
ps_name = sfnt[(3,1,0x0409,6)].decode(
702-
'utf-16be')
701+
ps_name = sfnt[3, 1, 0x0409, 6].decode('utf-16be')
703702
ps_name = ps_name.encode('ascii', 'replace').decode('ascii')
704703
self.set_font(ps_name, prop.get_size_in_points())
705704

lib/matplotlib/backends/backend_svg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def _write_svgfonts(self):
506506
font = get_font(font_fname)
507507
font.set_size(72, 72)
508508
sfnt = font.get_sfnt()
509-
writer.start('font', id=sfnt[1, 0, 0, 4].decode("macroman"))
509+
writer.start('font', id=sfnt[1, 0, 0, 4].decode("mac_roman"))
510510
writer.element(
511511
'font-face',
512512
attrib={

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,11 @@ def ttfFontProperty(font):
411411
sfnt2 = sfnt.get((1,0,0,2))
412412
sfnt4 = sfnt.get((1,0,0,4))
413413
if sfnt2:
414-
sfnt2 = sfnt2.decode('macroman').lower()
414+
sfnt2 = sfnt2.decode('mac_roman').lower()
415415
else:
416416
sfnt2 = ''
417417
if sfnt4:
418-
sfnt4 = sfnt4.decode('macroman').lower()
418+
sfnt4 = sfnt4.decode('mac_roman').lower()
419419
else:
420420
sfnt4 = ''
421421
if sfnt4.find('oblique') >= 0:

lib/matplotlib/textpath.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ def _get_char_id(self, font, ccode):
6767
"""
6868
sfnt = font.get_sfnt()
6969
try:
70-
ps_name = sfnt[(1, 0, 0, 6)].decode('macroman')
70+
ps_name = sfnt[1, 0, 0, 6].decode('mac_roman')
7171
except KeyError:
72-
ps_name = sfnt[(3, 1, 0x0409, 6)].decode('utf-16be')
72+
ps_name = sfnt[3, 1, 0x0409, 6].decode('utf-16be')
7373
char_id = urllib_quote('%s-%x' % (ps_name, ccode))
7474
return char_id
7575

0 commit comments

Comments
 (0)