Skip to content

Conversation

lukelbd
Copy link
Collaborator

@lukelbd lukelbd commented Jan 20, 2022

Resolves #318. Now mathtext.default is set to 'it' and I've changed the mathtext.it, mathtext.bf, mathtext.rm, and mathtext.sf from 'sans' to 'regular'.

Note the 'regular' string is a stand-in that tells matplotlib to use the current font. For example, 'regular:italic' applies italics to the current font. This is an improvement on previous behavior, in which only the unmodified (non-bold, non-italic) global font could be used for custom math text.

I've also added the Fira Sans, Noto Serif, and Source Serif Pro fonts. Previously I thought Fira Sans was redundant, but this is not the case, because Fira Math is not available in italics. Also, the Noto and Source serif fonts are nice companions for their sans-serif counterparts already included in proplot.

Here is the result of the demo function on reeadthedocs (note the italicezed math text):

fig, axs = pplt.show_fonts(family='sans-serif', math=True)

fonts_5_0

This supports the dummy entry 'regular' for 'custom' fontset
mathtext settings 'mathtext.it', 'mathtext.rm', etc. When detected
then the currently active font is selected rather than a global
default font. It also sets 'mathtext.default' to 'it'. Previously
this would result in math text resisting changes to the global font
but now this simply italices the current font and uses it for math.
@lukelbd lukelbd merged commit dc84abe into master Jan 20, 2022
@lukelbd lukelbd deleted the mathtext-font branch January 20, 2022 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Something wrong with italic fonts?

1 participant