Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
jkseppan merged 1 commit intomatplotlib:masterfromanntzer:unmathtext
Aug 2, 2020

Conversation

anntzer
Copy link
Contributor

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

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/next_api_changes/* if API changed in a backward-incompatible way

@anntzeranntzer added this to thev3.4.0 milestoneJul 21, 2020
@anntzeranntzerforce-pushed theunmathtext branch 2 times, most recently from46d9fd6 toea114bbCompareJuly 21, 2020 22:18
@@ -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))
Copy link
Member

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:

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)

Copy link
ContributorAuthor

@anntzeranntzerJul 29, 2020
edited
Loading

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.)

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.)
@jkseppanjkseppan merged commita0b9fe3 intomatplotlib:masterAug 2, 2020
@anntzeranntzer deleted the unmathtext branchAugust 2, 2020 09:06
@anntzeranntzer mentioned this pull requestOct 16, 2020
7 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jkseppanjkseppanjkseppan approved these changes

@QuLogicQuLogicQuLogic approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.4.0
Development

Successfully merging this pull request may close these issues.

3 participants
@anntzer@jkseppan@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp