Title: support ttc fonts · Issue #8612 · matplotlib/matplotlib · GitHub
Open Graph Title: support ttc fonts · Issue #8612 · matplotlib/matplotlib
X Title: support ttc fonts · Issue #8612 · matplotlib/matplotlib
Description: I am trying to use Chinese text in my plot. There are some pre-installed font on the system which support Chinese (using fc-list :lang=zh), for example "WenQuanYi Zen Hei". But I find that these fonts can not be found by matplotlib. I ch...
Open Graph Description: I am trying to use Chinese text in my plot. There are some pre-installed font on the system which support Chinese (using fc-list :lang=zh), for example "WenQuanYi Zen Hei". But I find that these fo...
X Description: I am trying to use Chinese text in my plot. There are some pre-installed font on the system which support Chinese (using fc-list :lang=zh), for example "WenQuanYi Zen Hei". But I find tha...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/8612
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"support ttc fonts","articleBody":"I am trying to use Chinese text in my plot. There are some pre-installed font on the system which support Chinese (using `fc-list :lang=zh`), for example \"WenQuanYi Zen Hei\". But I find that these fonts can not be found by matplotlib. I checked some of the code of font_manager. I find that font_manger seems intentionally avoid finding font files in ttc extensions. \r\n\r\nIn order to use these font, I have to explicitly give the path of the font, like the following example code:\r\n```\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.font_manager as mfm\r\nch_font = mfm.FontProperties(fname=\"/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc\")\r\nplt.annotate(xy=(0.5, 0.5), s=u'测试', xycoords='axes fraction', fontproperties=ch_font)\r\nplt.show()\r\n```\r\n\r\n\r\nWhat is the reason behind this ?\r\n\r\n**Matplotlib version**\r\n * Operating System: CentOS 7.2\r\n * Matplotlib Version: 2.0.1 \r\n * Python Version: 3.6\r\n\r\n\r\n","author":{"url":"https://github.com/jdhao","@type":"Person","name":"jdhao"},"datePublished":"2017-05-12T09:35:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/8612/matplotlib/issues/8612"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7cc3ea14-5c38-78d6-d36c-53d04e155c29 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E786:19F60D:148F96:1B7CD9:6A5162D7 |
| html-safe-nonce | c485f3b34c5d1713ba7a70ed6d99426d584aaaed01f359641b89b4b516051c95 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzg2OjE5RjYwRDoxNDhGOTY6MUI3Q0Q5OjZBNTE2MkQ3IiwidmlzaXRvcl9pZCI6IjEzMDgxNDk2NDYzNDA1MTI4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bbf8492ce6385b00fe5e422dc59615ef83e2ed8da5c7c62eb6f4b4b197eb5459 |
| hovercard-subject-tag | issue:228238553 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/8612/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0a910d09a423369006dd5e344190567fa2110d91542d4659c24c5a5807273067/matplotlib/matplotlib/issues/8612 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0a910d09a423369006dd5e344190567fa2110d91542d4659c24c5a5807273067/matplotlib/matplotlib/issues/8612 |
| og:image:alt | I am trying to use Chinese text in my plot. There are some pre-installed font on the system which support Chinese (using fc-list :lang=zh), for example "WenQuanYi Zen Hei". But I find that these fo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jdhao |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2eeb434949a926fad21064b4d395a54759f7a0b2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width