{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/124551064","pull_request_review_id":46849961,"id":124551064,"diff_hunk":"@@ -0,0 +1,401 @@\n+","path":"lib/matplotlib/_tff_header_parse.py","position":1,"original_position":1,"commit_id":"7a9183f28c7bb7d7b1476e05bad2937c01e29e79","original_commit_id":"86516103727465565deea7951163e3bd3abd0423","user":{"login":"jhelie","id":7881978,"avatar_url":"https://avatars3.githubusercontent.com/u/7881978?v=3","gravatar_id":"","url":"https://api.github.com/users/jhelie","html_url":"https://github.com/jhelie","followers_url":"https://api.github.com/users/jhelie/followers","following_url":"https://api.github.com/users/jhelie/following{/other_user}","gists_url":"https://api.github.com/users/jhelie/gists{/gist_id}","starred_url":"https://api.github.com/users/jhelie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhelie/subscriptions","organizations_url":"https://api.github.com/users/jhelie/orgs","repos_url":"https://api.github.com/users/jhelie/repos","events_url":"https://api.github.com/users/jhelie/events{/privacy}","received_events_url":"https://api.github.com/users/jhelie/received_events","type":"User","site_admin":false},"body":"the lgtm PR check is flagging some encoding issue. Python 2 uses `ascii` by default and Python 3 `utf-8` so that would explain why that's not an issue for you, but in a 2 environment I think this would be a problem\r\n","created_at":"2017-06-28T14:09:48Z","updated_at":"2017-06-28T14:09:48Z","html_url":"https://github.com/matplotlib/matplotlib/pull/8800#discussion_r124551064","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8800","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/124551064"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/8800#discussion_r124551064"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8800"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8800","id":127396868,"html_url":"https://github.com/matplotlib/matplotlib/pull/8800","diff_url":"https://github.com/matplotlib/matplotlib/pull/8800.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/8800.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8800","number":8800,"state":"open","locked":false,"title":"WIP: Fix font selection","user":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars0.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"body":"This pulls the commits from https://github.com/matplotlib/matplotlib/pull/8607 and https://github.com/matplotlib/matplotlib/pull/8551 together and starts to add starts to add code to standardize extracting the weight and style from the 4 places it could be stashed\r\n\r\nEventually this the weight / style selection code will look something like\r\n\r\n```bash\r\nfc-list : file > /tmp/font_list.txt\r\n```\r\n\r\n```python\r\nfrom matplotlib import ft2font\r\nfrom matplotlib import font_manager\r\nfrom pathlib import PurePath\r\nwith open('/tmp/font_list.txt', 'r') as fin:\r\n    font_paths = [_.strip().strip(':') for _ in fin.readlines()]\r\n\r\nfonts = []\r\n\r\nfor fn in font_paths:\r\n    fn = PurePath(fn)\r\n    if fn.suffix not in ('.otf', '.ttf'):\r\n        continue\r\n    try:\r\n        ft = ft2font.FT2Font(str(fn))\r\n        reasonable_effort_style = [v.lower().split() for v in get_all_style(ft.get_sfnt())]\r\n        reasonable_effort_style += [ft.style_name.lower().split()]\r\n        hit_weight = set(k for v in reasonable_effort_style for k in font_manager.weight_dict\r\n                         if k in v)\r\n        print(ft.family_name, reasonable_effort_style, hit_weight, sep=' | ')\r\n    except RuntimeError:\r\n        print('failed')\r\n```\r\n\r\nattn @cy18 @Rufflewind ","created_at":"2017-06-26T04:10:05Z","updated_at":"2017-06-28T14:09:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56bafe8a4b29d9afeb9824d2c57bba3daa8098a9","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12","html_url":"https://github.com/matplotlib/matplotlib/milestone/12","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12/labels","id":534144,"number":12,"title":"2.1 (next point release)","description":"Next feature release.\r\n\r\nBig ticket items:\r\n\r\n - MEP 22/27\r\n - traitlets","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars0.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":652,"closed_issues":965,"state":"open","created_at":"2014-01-13T03:21:09Z","updated_at":"2017-06-27T20:50:44Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8800/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8800/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8800/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/7a9183f28c7bb7d7b1476e05bad2937c01e29e79","head":{"label":"tacaswell:fix_font_selection","ref":"fix_font_selection","sha":"7a9183f28c7bb7d7b1476e05bad2937c01e29e79","user":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars0.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"repo":{"id":5345572,"name":"matplotlib","full_name":"tacaswell/matplotlib","owner":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars0.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tacaswell/matplotlib","description":null,"fork":true,"url":"https://api.github.com/repos/tacaswell/matplotlib","forks_url":"https://api.github.com/repos/tacaswell/matplotlib/forks","keys_url":"https://api.github.com/repos/tacaswell/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tacaswell/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tacaswell/matplotlib/teams","hooks_url":"https://api.github.com/repos/tacaswell/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/tacaswell/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/tacaswell/matplotlib/events","assignees_url":"https://api.github.com/repos/tacaswell/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/tacaswell/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/tacaswell/matplotlib/tags","blobs_url":"https://api.github.com/repos/tacaswell/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tacaswell/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tacaswell/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/tacaswell/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tacaswell/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/tacaswell/matplotlib/languages","stargazers_url":"https://api.github.com/repos/tacaswell/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/tacaswell/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/tacaswell/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/tacaswell/matplotlib/subscription","commits_url":"https://api.github.com/repos/tacaswell/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/tacaswell/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/tacaswell/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/tacaswell/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/tacaswell/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/tacaswell/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tacaswell/matplotlib/merges","archive_url":"https://api.github.com/repos/tacaswell/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tacaswell/matplotlib/downloads","issues_url":"https://api.github.com/repos/tacaswell/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/tacaswell/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/tacaswell/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/tacaswell/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tacaswell/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/tacaswell/matplotlib/releases{/id}","deployments_url":"https://api.github.com/repos/tacaswell/matplotlib/deployments","created_at":"2012-08-08T18:19:38Z","updated_at":"2016-11-11T21:59:38Z","pushed_at":"2017-06-28T02:14:47Z","git_url":"git://github.com/tacaswell/matplotlib.git","ssh_url":"git@github.com:tacaswell/matplotlib.git","clone_url":"https://github.com/tacaswell/matplotlib.git","svn_url":"https://github.com/tacaswell/matplotlib","homepage":"","size":396437,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"matplotlib:master","ref":"master","sha":"fcce35d8866b638b7fa537c968acbcf442f253af","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars3.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"repo":{"id":1385122,"name":"matplotlib","full_name":"matplotlib/matplotlib","owner":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars3.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matplotlib/matplotlib","description":"matplotlib: plotting with Python","fork":false,"url":"https://api.github.com/repos/matplotlib/matplotlib","forks_url":"https://api.github.com/repos/matplotlib/matplotlib/forks","keys_url":"https://api.github.com/repos/matplotlib/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matplotlib/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matplotlib/matplotlib/teams","hooks_url":"https://api.github.com/repos/matplotlib/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/matplotlib/matplotlib/events","assignees_url":"https://api.github.com/repos/matplotlib/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/matplotlib/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/matplotlib/matplotlib/tags","blobs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matplotlib/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/matplotlib/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/matplotlib/matplotlib/languages","stargazers_url":"https://api.github.com/repos/matplotlib/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/matplotlib/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/matplotlib/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/matplotlib/matplotlib/subscription","commits_url":"https://api.github.com/repos/matplotlib/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/matplotlib/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/matplotlib/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/matplotlib/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matplotlib/matplotlib/merges","archive_url":"https://api.github.com/repos/matplotlib/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matplotlib/matplotlib/downloads","issues_url":"https://api.github.com/repos/matplotlib/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/matplotlib/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/matplotlib/matplotlib/releases{/id}","deployments_url":"https://api.github.com/repos/matplotlib/matplotlib/deployments","created_at":"2011-02-19T03:17:12Z","updated_at":"2017-06-28T14:06:45Z","pushed_at":"2017-06-28T09:27:04Z","git_url":"git://github.com/matplotlib/matplotlib.git","ssh_url":"git@github.com:matplotlib/matplotlib.git","clone_url":"https://github.com/matplotlib/matplotlib.git","svn_url":"https://github.com/matplotlib/matplotlib","homepage":"http://matplotlib.org/","size":306846,"stargazers_count":5458,"watchers_count":5458,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2627,"mirror_url":null,"open_issues_count":1222,"forks":2627,"open_issues":1222,"watchers":5458,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8800"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/8800"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/8800"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/8800/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8800/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8800/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/7a9183f28c7bb7d7b1476e05bad2937c01e29e79"}}}}
{"actor":{"display_login":"jhelie"}}