10000 Look for font information in more locations · matplotlib/matplotlib@a30b491 · GitHub
[go: up one dir, main page]

Skip to content

Commit a30b491

Browse files
cy18tacaswell
authored andcommitted
Look for font information in more locations
Try get font information from Platform 3(Windows Unicode) if no information got from Platform 1, encoding 0(Mac Roman)
1 parent ab782ba commit a30b491

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/font_manager.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,20 @@ def ttfFontProperty(font):
409409

410410
sfnt = font.get_sfnt()
411411
sfnt2 = sfnt.get((1,0,0,2))
412+
sfnt2_3 = sfnt.get((3,1,1033,2))
412413
sfnt4 = sfnt.get((1,0,0,4))
414+
sfnt4_3 = sfnt.get((3,1,1033,4))
413415
if sfnt2:
414416
sfnt2 = sfnt2.decode('macroman').lower()
417+
elif sfnt2_3:
418+
sfnt2 = sfnt2_3.decode('utf_16_be').lower()
415419
else:
416420
sfnt2 = ''
421+
417422
if sfnt4:
418423
sfnt4 = sfnt4.decode('macroman').lower()
424+
elif sfnt4_3:
425+
sfnt4 = sfnt4_3.decode('utf_16_be').lower()
419426
else:
420427
sfnt4 = ''
421428
if sfnt4.find('oblique') >= 0:

0 commit comments

Comments
 (0)
0