-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove the use_cmex font fallback mechanism. #18721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functionality is gone. This should get an API-Change note.
lib/matplotlib/_mathtext.py
Outdated
@@ -452,7 +451,7 @@ class UnicodeFonts(TruetypeFonts): | |||
This class will "fallback" on the Bakoma fonts when a required | |||
symbol can not be found in the font. | |||
""" | |||
use_cmex = True | |||
use_cmex = True # Deprecated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is more helpful for us in the future:
use_cmex = True # Deprecated. | |
use_cmex = True # Unused. Delete once matplotlib.mathtext is private. |
Same comment should be used below as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup
It's not gone, fallback still works (as long as you have |
The `use_cmex` flag and `latex_to_cmex` table is a fallback-to-computermodern mathtext system that is strictly less powerful than the `mathtext.fallback_to_cm` (now `mathtext.fallback`) system. Also, the `latex_to_cmex` table was incomplete. Previously, with something like ``` rcParams["mathtext.fontset"] = "custom"; figtext(.5, .5, r"$\leftangle\langle$") ``` `\leftangle` would get unconditionally replaced by a Computer Modern glyph, whereas `\langle` would stay as DejaVu Sans (as DejaVu provides that glyph). With this patch, both glyphs now use DejaVu. Conversely, if one forces the use of a font which does not contain the `\langle` glyph (e.g. adding `rcParams["mathtext.rm"] = "Comic Sans MS"`), then both `\leftangle` and `\langle` get substituted to use Computer Modern; this is not changed by this PR (except that now *both* fallbacks can be controlled by `rcParams["mathtext.fallback"]`. `latex_to_cmex` and `use_cmex` were marked as deprecated, but with no actual deprecation machinery as they can all go away once `mathtext` fully goes private anyways.
7e7c5ab
to
b1691d9
Compare
The
use_cmex
flag andlatex_to_cmex
table is afallback-to-computermodern mathtext system that is strictly less
powerful than the
mathtext.fallback_to_cm
(nowmathtext.fallback
)system. Also, the
latex_to_cmex
table was incomplete.Previously, with something like
\leftangle
would get unconditionally replaced by a Computer Modernglyph, whereas
\langle
would stay as DejaVu Sans (as DejaVu providesthat glyph). With this patch, both glyphs now use DejaVu.
Conversely, if one forces the use of a font which does not contain the
\langle
glyph (e.g. addingrcParams["mathtext.rm"] = "Comic Sans MS"
), then both\leftangle
and\langle
get substituted to useComputer Modern; this is not changed by this PR (except that now both
fallbacks can be controlled by
rcParams["mathtext.fallback"]
.latex_to_cmex
anduse_cmex
were marked as deprecated, but with noactual deprecation machinery as they can all go away once
mathtext
fully goes private anyways.
PR Summary
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
andpydocstyle<4
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).