| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Closes matplotlib#29866 This commit adds support for rcParam 'font.superfamily', allowing users to define logical font groups (superfamilies) that span multiple genres like 'serif', 'sans', and 'mono'. Each superfamily maps genre + weight + style to real font names using keys like 'bold-italic' or 'normal-normal'. Font resolution uses genre from font.family and matches against the selected superfamily, trying exact and fallback variants in order of specificity to generality. Superfamilies can be defined by name (preloaded registry) or passed as inline dicts in rcParams['font.superfamily']. Legacy behavior is preserved unless superfamily is set. If set, genre-aware matching replaces generic family name. Includes defaults for DejaVu, Noto, Liberation, and more. Co-authored-by: Tiago Marques <tiago.l.marques@tecnico.ulisboa.pt>
There was a problem hiding this comment.
I still don't know if we really want that feature, but if we do, it would definitely not by using a hard-coded table, but more likely by extracting the relevant metadata from the font files.
Sorry, something went wrong.
Ok, I'll look into that. About the part of extracting metadata, is it worth to add more dependencies to mpl ? |
Sorry, something went wrong.
|
Hopefully it can be done without additional dependencies. |
Sorry, something went wrong.
|
We already have fonttools as a dependency. I would be surprised if there was metadata available to us in fonts that we could not get out with the dependencies we already have. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #29866
Adds support for rcParam 'font.superfamily', allowing users to define logical font groups (superfamilies) that span multiple genres like 'serif', 'sans', and 'mono'.
Each superfamily maps genre + weight + style to real font names using keys like 'bold-italic' or 'normal-normal'.
Font resolution uses genre from font.family and matches against the selected superfamily, trying exact and fallback variants in order of specificity to generality.
Superfamilies can be defined by name (preloaded registry) or passed as inline dicts in rcParams['font.superfamily'].
Legacy behavior is preserved unless superfamily is set. If set, genre-aware matching replaces generic family name.
Includes defaults for DejaVu, Noto, Liberation, and more.
PR summary
PR checklist