Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Deprecate various vector-backend-specific mathtext helpers.#18002
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
46d9fd6
toea114bb
CompareUh oh!
There was an error while loading.Please reload this page.
@@ -2072,6 +2078,7 @@ def draw_mathtext(self, gc, x, y, s, prop, angle): | |||
0.001 * fontsize, 0, | |||
0, 0.001 * fontsize, | |||
ox, oy, Op.concat_matrix) | |||
symbol_name = font.get_glyph_name(font.get_char_index(num)) |
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.
There are some fallbacks; do we need to worry about those here:
matplotlib/lib/matplotlib/mathtext.py
Lines 690 to 697 in03aebfb
iffontisnotNone: | |
gid=font.get_char_index(num) | |
ifgid!=0: | |
symbol_name=font.get_glyph_name(gid) | |
ifsymbol_nameisNone: | |
returnself._stix_fallback._get_glyph( | |
fontname,font_class,sym,fontsize,math) |
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.
No, because _stix_fallback._get_glyph(...) will return a different font object (for which the glyph exists). This can be checked e.g. with
rcParams["mathtext.fontset"]="cm";figtext(.5,.5,"$\\perp$");savefig("/tmp/out.pdf")
adding a print to check that fallback occurs. (Actually it looks like this shouldnot fallback as there's a \perp sign in cmsy10.ttf? but that's a separate issue.)
Uh oh!
There was an error while loading.Please reload this page.
A single mathtext "backend" yielding a list of glyphs and rectangles isenough; renderer-specific logic can be implemented in the rendererthemselves.(MathtextBackendAgg needs to stay separate because it uses a differentfont hinting flag.)
A single mathtext "backend" yielding a list of glyphs and rectangles is
enough; renderer-specific logic can be implemented in the renderer
themselves.
(MathtextBackendAgg needs to stay separate because it uses a different
font hinting flag.)
PR Summary
PR Checklist