8000 WIP: Fix font selection by tacaswell · Pull Request #8800 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

WIP: Fix font selection #8800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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)
  • Loading branch information
cy18 authored and tacaswell committed Jun 28, 2017
commit a30b4910f02d158f7d257f015702ce0b6e7df7ab
7 changes: 7 additions & 0 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,20 @@ def ttfFontProperty(font):

sfnt = font.get_sfnt()
sfnt2 = sfnt.get((1,0,0,2))
sfnt2_3 = sfnt.get((3,1,1033,2))
sfnt4 = sfnt.get((1,0,0,4))
sfnt4_3 = sfnt.get((3,1,1033,4))
if sfnt2:
sfnt2 = sfnt2.decode('macroman').lower()
elif sfnt2_3:
sfnt2 = sfnt2_3.decode('utf_16_be').lower()
else:
sfnt2 = ''

if sfnt4:
sfnt4 = sfnt4.decode('macroman').lower()
elif sfnt4_3:
sfnt4 = sfnt4_3.decode('utf_16_be').lower()
else:
sfnt4 = ''
if sfnt4.find('oblique') >= 0:
Expand Down
0