Title: [ENH]: Per-font size scaling (-> math text) · Issue #32074 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Per-font size scaling (-> math text) · Issue #32074 · matplotlib/matplotlib
X Title: [ENH]: Per-font size scaling (-> math text) · Issue #32074 · matplotlib/matplotlib
Description: Problem In typography, the concept of point sizes often does not have a 1:1 mapping to the "visual weight" of a font, and to harmoniously integrate two typefaces, it is quite common to want to use slightly different sizes. For instance, ...
Open Graph Description: Problem In typography, the concept of point sizes often does not have a 1:1 mapping to the "visual weight" of a font, and to harmoniously integrate two typefaces, it is quite common to want to use ...
X Description: Problem In typography, the concept of point sizes often does not have a 1:1 mapping to the "visual weight" of a font, and to harmoniously integrate two typefaces, it is quite common to wa...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/32074
X: @github
Domain: Github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Per-font size scaling (-\u003e math text)","articleBody":"### Problem\n\nIn typography, the concept of point sizes often does not have a 1:1 mapping to the \"visual weight\" of a font, and to harmoniously integrate two typefaces, it is quite common to want to use slightly different sizes. For instance, matching the x-height (lowercase character height) often creates visually more balanced results than choosing the same size. (A quick search turned up this random issue with an image demonstrating the variability in visual appearance for the same nominal point size: https://github.com/w3c/low-vision-a11y-tf/discussions/112.)\n\nThis comes up particularly often when trying to combine sans-serif fonts with math text. For instance, I might want 8.2 pt Avenir Next, but 9 pt Computer Modern (`mathtext.fontset: cm`) to go with it. Currently, there does not seem to be a way to individually tune the sizes of regular text (or \\mathdefault{}) vs. math text.\n\n### Proposed solution\n\nAn ideal solution would be to be able to specify a scale factor to apply to each font. For instance, `fontspec` in LaTeX allows one to specify `\\setsansfont[Scale=1.2]{MyFont.otf}`. (In fact, `fontspec` even supports `Scale=MatchLowercase`, but just being able to input a scale factor would be good enough; the automatic scaling isn't always perfect anyway.) Something like a `mathtext.fontscale` rc parameter (or maybe per font in case fallbacks are used?).\n\nI am happy to give implementing this a go, but I assume the local font stack expert might have advice as to how best (not) to approach this.","author":{"url":"https://github.com/dnadlinger","@type":"Person","name":"dnadlinger"},"datePublished":"2026-07-19T15:08:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/32074/matplotlib/issues/32074"}
| 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:e2d42187-dd26-e67b-f070-bbaf5f36929c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DDCA:1E76C4:8104D8:AE5431:6A62836A |
| html-safe-nonce | 4649590bed257cddaa9e2e372d4883e97b2875ff91b8c9dd150400068d413591 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERENBOjFFNzZDNDo4MTA0RDg6QUU1NDMxOjZBNjI4MzZBIiwidmlzaXRvcl9pZCI6IjgwOTYwNzA5MzMwNzY0MTEyNDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d0dd523c9d75bc161cd7bb2ced21c81046c0a53d7a1853d2310c2e6333983b0c |
| hovercard-subject-tag | issue:4923190425 |
| 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/32074/issue_layout |
| twitter:image | https://opengraph.githubassets.com/df1d70f86cf66f18515d5b790c044d071d8f92d1f3a5eced88075b766aae5df1/matplotlib/matplotlib/issues/32074 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/df1d70f86cf66f18515d5b790c044d071d8f92d1f3a5eced88075b766aae5df1/matplotlib/matplotlib/issues/32074 |
| og:image:alt | Problem In typography, the concept of point sizes often does not have a 1:1 mapping to the "visual weight" of a font, and to harmoniously integrate two typefaces, it is quite common to want to use ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dnadlinger |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7a4ef49a11a2c05de16a801b29c54a151d2e3262d6fd17381ca13b5ae25dda8f |
| 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 | 97b18c8f1d2683a31995fd6e802daf9bf0d4d3f0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width