Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Emit non BMP chars as XObjects in PDF #20633

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 2 commits into from
Jul 22, 2021

Conversation

sauerburger
Copy link
Member

@sauerburger sauerburger commented Jul 12, 2021

PR Summary

Closes #20616

This PR address #20616 and emits Type 42 chars from beyond the Basic Multilingual Plane as XObjects, similar to the treatment of multi-byte chars in Type 3 fonts.

This PR builds on top of #20615.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@sauerburger sauerburger changed the title Pdf non bmp chars Emit non BMP chars as XObjects in PDF Jul 12, 2021
Copy link
Contributor

@aitikgupta aitikgupta left a 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 close to what @anntzer mentioned by splitting characters into 'multi-bytes' for Type 42 as well (briefly during the call and on #18191).

Looks good! 🎉

Test that character beyond the Basic Multilingual Plane are supported in PDF
files with Type 42 fonts. The example tests STIX Sans math chars and a char
from an old script.
Currently, the CID maps only support 2-byte fixed-width characters. Unicode
points beyond the Basic Multilingual Plane cannot be used. This comment follows
the strategy taken for Type 3 fonts. Any char with a code point > 65535 is
emitted as an XObject.
Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

I'm approving in lieu of @aitikgupta, not because I understand the font handling here.

@QuLogic QuLogic merged commit bd127f3 into matplotlib:master Jul 22, 2021
@sauerburger sauerburger mentioned this pull request Jul 22, 2021
7 tasks
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.

Type 42 chars beyond BMP not displayed in PDF
4 participants