Title: [ENH]: Explicit file paths for font rcParams · Issue #28147 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Explicit file paths for font rcParams · Issue #28147 · matplotlib/matplotlib
X Title: [ENH]: Explicit file paths for font rcParams · Issue #28147 · matplotlib/matplotlib
Description: Problem I'm always frustrated while setting the fonts of text in plots. To begin with, I want the readers to be noticed that I do know a couple of ways to set fonts, and I am here just to give an advise. I use Windows to be the environme...
Open Graph Description: Problem I'm always frustrated while setting the fonts of text in plots. To begin with, I want the readers to be noticed that I do know a couple of ways to set fonts, and I am here just to give an a...
X Description: Problem I'm always frustrated while setting the fonts of text in plots. To begin with, I want the readers to be noticed that I do know a couple of ways to set fonts, and I am here just to give ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/28147
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Explicit file paths for font rcParams","articleBody":"### Problem\r\n\r\nI'm always frustrated while setting the fonts of text in plots. To begin with, I want the readers to be noticed that I **do know** a couple of ways to set fonts, and I am here just to give an advise.\r\n\r\n---\r\n\r\nI use **Windows** to be the environment here. The phenomenons are as follows.\r\nThe `font.sans-serif property` in file \"matplotlibrc\" in the \"site-packages\\matplotlib\\mpl-data\" directory is \"DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif, **simkai**\". As you can see,\r\n- there is an item called \"simkai\" in it, \r\n- and \"simkai.ttf\" is located in both \r\n - `site-packages\\matplotlib\\mpl-data\\fonts\\ttf`\r\n - `C:\\Windows\\fonts`\r\n\r\nHowever, Matplotlib **is not able** to find the font name, and raise the warning \"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimKai\".\r\n\r\nSo, where could the user find and set it? There is a json file within the folder `%Userprofile%\\.matplotlib`. The font \"simkai.ttf\" is named by \"kaiti\" in json.\r\n\r\nOn the contrary, after I set `plt.rcParams['font.sans-serif']=['SimSun']`, the font \"**simsun**\" could be recognized correctly. To be noticed, there are no font files named like \"simsun*.ttf\" in directories mentioned above. There is only a \"C:\\Windows\\fonts\\simsun.ttc\".\r\n\r\nSimilar to what occurred with \"kaiti\", the way and the only way to recognize \"simsun\" is to search by the **json** file under `%userprofile%`.\r\n\r\nI consider this searching mode to be wired and inconvenient.\r\n\r\n\r\n### Proposed solution\r\n\r\nMaybe, the logic could be removed from the personal configuration on the system disk. Or add the behavior in **User Guide**?","author":{"url":"https://github.com/ChestnutA","@type":"Person","name":"ChestnutA"},"datePublished":"2024-04-28T11:30:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/28147/matplotlib/issues/28147"}
| 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:b202c423-d054-36ac-415c-14071eaf080c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 90B0:497D6:DC580E:12A9053:6A51FC8D |
| html-safe-nonce | 1e7cdd8e03fb795da0640d23ed804a20731052fb1180d51b0406091837e03df0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEIwOjQ5N0Q2OkRDNTgwRToxMkE5MDUzOjZBNTFGQzhEIiwidmlzaXRvcl9pZCI6IjI1MzU0NDAwNzMwNDYwODkwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6737ac3701aff3afa61a6e12f84a38bac6340908d71594a338ab6cdb6915c225 |
| hovercard-subject-tag | issue:2267498576 |
| 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/28147/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fdbd9bf9e13d46e35cd903cae04e24d97a903b5d200401e3055f51b8b8c59553/matplotlib/matplotlib/issues/28147 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fdbd9bf9e13d46e35cd903cae04e24d97a903b5d200401e3055f51b8b8c59553/matplotlib/matplotlib/issues/28147 |
| og:image:alt | Problem I'm always frustrated while setting the fonts of text in plots. To begin with, I want the readers to be noticed that I do know a couple of ways to set fonts, and I am here just to give an a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ChestnutA |
| 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