Title: Rely on OS-level tools for building the font cache · Issue #10932 · matplotlib/matplotlib · GitHub
Open Graph Title: Rely on OS-level tools for building the font cache · Issue #10932 · matplotlib/matplotlib
X Title: Rely on OS-level tools for building the font cache · Issue #10932 · matplotlib/matplotlib
Description: The root issue of #10201 appears to be that in some OSX systems, /FontCollections is included in the font paths searched by the system, but not listed in the hardcoded paths in font_manager.py. While this could be fixed in a piecemeal fa...
Open Graph Description: The root issue of #10201 appears to be that in some OSX systems, /FontCollections is included in the font paths searched by the system, but not listed in the hardcoded paths in font_manager.py. Whi...
X Description: The root issue of #10201 appears to be that in some OSX systems, /FontCollections is included in the font paths searched by the system, but not listed in the hardcoded paths in font_manager.py. Whi...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/10932
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rely on OS-level tools for building the font cache","articleBody":"The root issue of #10201 appears to be that in some OSX systems, /FontCollections is included in the font paths searched by the system, but not listed in the hardcoded paths in font_manager.py. While this could be fixed in a piecemeal fashion, I would like to propose instead to strictly rely on OS-level tools to list fonts instead.\r\n\r\nThis means:\r\n- on Linux, `fc-list --format='%{file}\\n'`\r\n- on OSX, `system_profiler SPFontsDataType` (whose output can trivially be parsed by the stdlib plistlib module) (and fc-list too, if it is present).\r\n\r\nOn Linux, Xorg relies on fontconfig for font selection since at least X11R6.9 (2005; https://www.x.org/archive/X11R6.9.0/doc/html/fonts2.html#3 -- oldest doc on x.org). On OSX, system_profiler appears to be available since at least OSX 10.0 (2001; https://en.wikipedia.org/wiki/System_Information_(Mac)).\r\n\r\nOn Windows, we are already reading the fonts and font paths from the registry, which appears to be the \"correct\" place where the info is stored (https://msdn.microsoft.com/en-us/library/windows/desktop/dd144833(v=vs.85).aspx).\r\n\r\nThis means that on (rare) systems where fontconfig is not present, we'll only find the fonts shipped with Matplotlib (dejavu, etc.). To work around this, we can allow the user to run `python -mmatplotlib.font_manager recache --add-font-path foo --add-font-path bar`, with the expected effect (in fact there's already the (undocumented) `TTFPATH` and `AFMPATH` environment variables which have the same effect).\r\n\r\nThoughts?","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2018-03-31T23:45:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/10932/matplotlib/issues/10932"}
| 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:51ce41ad-136b-7e11-33c9-25698a3c8baf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8574:1960:4E5ED67:6EA162E:6A504805 |
| html-safe-nonce | 62d1437e320b1abf6168bae99715f50d84133bfae8752f8ead88b6bd3e4bd883 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTc0OjE5NjA6NEU1RUQ2Nzo2RUExNjJFOjZBNTA0ODA1IiwidmlzaXRvcl9pZCI6IjQ4MTU1NjgwODc2ODczODMwNDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b5f875146ece1ba0ad44f5cc73a4353de4010080a905ce5fa84835fd6f4eeea0 |
| hovercard-subject-tag | issue:310280566 |
| 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/10932/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0b08e8b831cd8636afe583d23c66f6ba5e71421b7a759a1742ae30b9995ca6f8/matplotlib/matplotlib/issues/10932 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0b08e8b831cd8636afe583d23c66f6ba5e71421b7a759a1742ae30b9995ca6f8/matplotlib/matplotlib/issues/10932 |
| og:image:alt | The root issue of #10201 appears to be that in some OSX systems, /FontCollections is included in the font paths searched by the system, but not listed in the hardcoded paths in font_manager.py. Whi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| 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 | 5741a45fe07e5f377d0d4c524a92e3056acc51bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width