Title: RuntimeError In FT2Font with NISC18030.ttf · Issue #7305 · matplotlib/matplotlib · GitHub
Open Graph Title: RuntimeError In FT2Font with NISC18030.ttf · Issue #7305 · matplotlib/matplotlib
X Title: RuntimeError In FT2Font with NISC18030.ttf · Issue #7305 · matplotlib/matplotlib
Description: We're trying to fix the font in our MPL scripts to avoid PNG and PDF images changing depending on who produced it (Linux / Mac machines, different MPL versions). So our idea was to find one font that everyone has and set that font. How c...
Open Graph Description: We're trying to fix the font in our MPL scripts to avoid PNG and PDF images changing depending on who produced it (Linux / Mac machines, different MPL versions). So our idea was to find one font th...
X Description: We're trying to fix the font in our MPL scripts to avoid PNG and PDF images changing depending on who produced it (Linux / Mac machines, different MPL versions). So our idea was to find one fon...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/7305
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"RuntimeError In FT2Font with NISC18030.ttf","articleBody":"We're trying to fix the font in our MPL scripts to avoid PNG and PDF images changing depending on who produced it (Linux / Mac machines, different MPL versions).\n\nSo our idea was to find one font that everyone has and set that font.\nHow can I find out if I have 'Bitstream Vera Sans' (or some other font) available in my MPL install?\n\nI tried this and got a RunTimeError.\nIs this a bug or am I doing it wrong?\n\n```\nIn [1]: %paste\nimport matplotlib.font_manager\nflist = matplotlib.font_manager.get_fontconfig_fonts()\nnames = [matplotlib.font_manager.FontProperties(fname=fname).get_name() for fname in flist]\nprint('Bitstream Vera Sans' in names)\n\n## -- End pasted text --\n/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.\n warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')\n---------------------------------------------------------------------------\nRuntimeError Traceback (most recent call last)\n\u003cipython-input-1-d6f6752cbc94\u003e in \u003cmodule\u003e()\n 1 import matplotlib.font_manager\n 2 flist = matplotlib.font_manager.get_fontconfig_fonts()\n----\u003e 3 names = [matplotlib.font_manager.FontProperties(fname=fname).get_name() for fname in flist]\n 4 print('Bitstream Vera Sans' in names)\n\n\u003cipython-input-1-d6f6752cbc94\u003e in \u003clistcomp\u003e(.0)\n 1 import matplotlib.font_manager\n 2 flist = matplotlib.font_manager.get_fontconfig_fonts()\n----\u003e 3 names = [matplotlib.font_manager.FontProperties(fname=fname).get_name() for fname in flist]\n 4 print('Bitstream Vera Sans' in names)\n\n/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/font_manager.py in get_name(self)\n 735 properties.\n 736 \"\"\"\n--\u003e 737 return ft2font.FT2Font(findfont(self)).family_name\n 738 \n 739 def get_style(self):\n\nRuntimeError: In FT2Font: Could not set the fontsize\n```\n\nPython 3.5 and MPL 1.5.3 from Macports on macOS.\n","author":{"url":"https://github.com/cdeil","@type":"Person","name":"cdeil"},"datePublished":"2016-10-19T12:48:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/7305/matplotlib/issues/7305"}
| 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:24622894-3bce-db17-f79b-0e3783f66e8f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D74A:1393E7:11A7DC8:181654C:6A521338 |
| html-safe-nonce | 667b4259360eb1757b146430a7d86912c3fa583f4376312cf1e4add52d3c9762 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzRBOjEzOTNFNzoxMUE3REM4OjE4MTY1NEM6NkE1MjEzMzgiLCJ2aXNpdG9yX2lkIjoiODgzMzA2NTYyMjg5NDE1NDU1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9773b1136e1bf19d5fa6b6a52b22bacd0d8f3d1b9540b6268e272ddc637ffdea |
| hovercard-subject-tag | issue:183952233 |
| 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/7305/issue_layout |
| twitter:image | https://opengraph.githubassets.com/76084bf53a1c05e8f7a83cd2774f393415d3139e3666bae1e4875a6240b7ceac/matplotlib/matplotlib/issues/7305 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/76084bf53a1c05e8f7a83cd2774f393415d3139e3666bae1e4875a6240b7ceac/matplotlib/matplotlib/issues/7305 |
| og:image:alt | We're trying to fix the font in our MPL scripts to avoid PNG and PDF images changing depending on who produced it (Linux / Mac machines, different MPL versions). So our idea was to find one font th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cdeil |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width