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

Improve readability of _mathtext_data.stix_virtual_fonts table#25990

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

Conversation

lucavribeiro
Copy link

PR summary

Hi! I made some changes on mathtext_data file to improve readability (using Unicode character name in order to make to code clearer) as asked (issue 25738).

So, i changed the table from like this:

(0x0393, 0x0393, 'it', 0x213e),  # \Gamma (not in beta STIX fonts)(0x03a0, 0x03a0, 'it', 0x213f),  # \Pi

To this:

 ("\N{GREEK CAPITAL LETTER GAMMA}", "\N{GREEK CAPITAL LETTER GAMMA}",     'it', 0x213e), ("\N{GREEK CAPITAL LETTER PI}", "\N{GREEK CAPITAL LETTER PI}",     'it', 0x213f),

PR checklist

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping@matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

Using ord function to convert the unicode to an integer
(0x03a3, 0x03a3, 'rm', 0x2140), # \Sigma
(0x03b3, 0x03b3, 'rm', 0x213d), # \gamma
(0x03c0, 0x03c0, 'rm', 0x213c), # \pi
(ord("\N{GREEK CAPITAL LETTER GAMMA}"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I would also replace the codepoints above (0x0030 ="0" (no real need to write that as"\N{DIGIT ZERO}")), as well as the last items of the tuplewhen applicable (0x213e ="\N{DOUBLE-STRUCK CAPITAL GAMMA}" but 0x1d7d8 is just an internal codepoint for the font with no associated name).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hi, thanks for the feedback! I included replacements for these codepoints and for the last items that i could find as well in my last commit

replaced digits and letters
@QuLogic
Copy link
Member

As noted in the issue, I don't think you want to writeord everywhere, and instead replace that with a dict/list comprehension that calls it in one place for everything.

anntzer reacted with thumbs up emoji

@lucavribeirolucavribeiro marked this pull request as draftMay 30, 2023 22:01
@lucavribeirolucavribeiro marked this pull request as ready for reviewMay 30, 2023 23:31
@lucavribeiro
Copy link
Author

Thanks for the feedback@QuLogic! I've updated the code to include the list and dict comprehension now. For the unicodes list i had to include "\N{}" in the strings so it wouldn't throw an error when it loops because of "0", "9" and the letters strings. Btw, i really couldn't identify why there is a linting problem

Copy link
Member

@QuLogicQuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think there's a need forlist_uni oruni_map; that's basically a longer way of writingord. Rather, just write out the text in each of the tables, and do one dict/list comprehension at the end over everything instix_virtual_fonts. If you need to mix characters and ordinals, then perhaps only do that on the lists that need it directly.

@lucavribeirolucavribeiro marked this pull request as draftJuly 8, 2023 12:48
@devRDdevRD mentioned this pull requestSep 19, 2023
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@anntzeranntzeranntzer left review comments

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

Assignees
No one assigned
Projects
Status: Waiting for author
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[MNT]: Improve readability of _mathtext_data.stix_virtual_fonts table
4 participants
@lucavribeiro@QuLogic@anntzer@rcomer

[8]ページ先頭

©2009-2025 Movatter.jp