Skip to content

Shorten the type1-to-unicode name table. #16421

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

Merged
merged 1 commit into from
Mar 10, 2020
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 5, 2020

This table is actually only used as "uni2type1" to convert unicode
characters to "Adobe Type 1" glyph names. In fact, "unknown" characters
all get converted to "uni1234" where 1234 is hex(ord(c)); see e.g.
https://blogs.adobe.com/CCJKType/2013/06/font-development-via-unicode.html

Given that type12uni doesn't include all code points anyways, we may
as well generate the "uni1234"-type names as needed instead. In both
places where this is used, if we don't find "uni1234" in the table we
already fallback to "question" (just below the patch).

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 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/api_changes.rst if API changed in a backward-incompatible way

This table is actually only used as "uni2type1" to convert unicode
characters to "Adobe Type 1" glyph names.  In fact, "unknown" characters
all get converted to "uni1234" where 1234 is `hex(ord(c))`; see e.g.
https://blogs.adobe.com/CCJKType/2013/06/font-development-via-unicode.html

Given that type12uni doesn't include *all* code points anyways, we may
as well generate the "uni1234"-type names as needed instead.  In both
places where this is used, if we don't find "uni1234" in the table we
already fallback to "question" (just below the patch).
@tacaswell tacaswell added this to the v3.3.0 milestone Feb 8, 2020
@tacaswell
Copy link
Member

What generates _mathtext_data.py?

@anntzer
Copy link
Contributor Author

anntzer commented Feb 10, 2020

Probably a script lost in the mists of time...

@QuLogic QuLogic merged commit 07a108f into matplotlib:master Mar 10, 2020
@anntzer anntzer deleted the type12uni branch March 10, 2020 07:00
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.

4 participants