Skip to content
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

name2unicode() should follow the Adobe Glyph List Specification #263

Merged

Conversation

pietermarsman
Copy link
Member

@pietermarsman pietermarsman commented Jul 10, 2019

Fixes #177
Fixes #261
Fixes #204

@pietermarsman pietermarsman changed the title Add some (failing) unittests for name2unicode based on the examples in the Adobe Glyph List Specification name2unicode() should follow the Adobe Glyph List Specification Jul 10, 2019
@pietermarsman
Copy link
Member Author

Just an update of what I've been doing:

  • I've been testing name2unicode() with the samples/nonfree/f1040nr.pdf.
  • For this pdf it is called from EncodingDb.get_encoding() and from Type1FontHeaderParser.get_encoding(). This latter causes a problem, because it has a font that maps cid's to glyph-names in the form of \H[0-9]+.
  • This form is not a valid glyph-name according to Adobe. The current name2unicode() extracts the number part and returns the corresponding unicode character. This is wrong (for this document), since it returns chinese characters for an american document.
  • I am trying to figure out how to the \H[0-9]+ should be mapped to valid characters.
  • My best guess now is that there is some information in the encrypted part of the embedded font program (see PDF Reference 1.6, page 437)

@pietermarsman pietermarsman marked this pull request as ready for review July 14, 2019 13:55
pdfminer/encodingdb.py Outdated Show resolved Hide resolved
pdfminer/encodingdb.py Outdated Show resolved Hide resolved
Copy link
Member

@tataganesh tataganesh left a comment

Choose a reason for hiding this comment

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

Some small changes.

@tataganesh
Copy link
Member

Also is this an extension of #204?

@pietermarsman
Copy link
Member Author

Thanks for the feedback. No time left today to fix it, so I will look into this tomorrow.

@pietermarsman
Copy link
Member Author

Also is this an extension of #204?

Yes, this is also implements the behaviour described by @jbarlow83, and more.

@robinalexandre
Copy link

Do you know when this PR and all the others about name2unicode and Cmap will be merged ?

I think we are a lot waiting for it and it seems like checks have passed 👍

Thanks to all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants