8000 Fixes #1675 - T1 eexec end finding spec compliance by baileyparker · Pull Request #1676 · fonttools/fonttools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixes #1675 - T1 eexec end finding spec compliance #1676

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

Conversation

baileyparker
Copy link
Contributor

The T1 spec (https://www-cdf.fnal.gov/offline/PostScript/T1_SPEC.PDF) on
page 14 says that:

The text encrypted by eexec must be followed by 512 ASCII zeros. There may be
white space characters (blank, tab, carriage return or line feed)
interspersed among these zeros.

  • Add a failing test case with white space characters interspersed
    among the trailing zeros after the eexec

  • Fix eexec end finding so that it passes this new test case

This modification to the method for finding the end of the eexec section is more robust than the current method (which looks for 64 consecutive ASCII 0s immediately after the encrypted text ends) as it handles the spec's allowance for arbitrary interspersed whitespace. A regex was convenient here (and was already used in findEncryptedChunks), but it could be unrolled into a function if need be.

While more robust than the existing function, it's unclear to me how the spec would handle an eexec section that coincidentally has 512 ASCII 0s in the middle of it (or any combination of that with interspersed whitespace). This approach does not handle that, but neither does the existing solution.

The T1 spec (https://www-cdf.fnal.gov/offline/PostScript/T1_SPEC.PDF) on
page 14 says that:

> The text encrypted by eexec must be followed by 512 ASCII zeros. There may be
> white space characters (blank, tab, carriage return or line feed)
> interspersed among these zeros.

  * Add a failing test case with white space characters interspersed
    among the trailing zeros after the eexec

  * Fix eexec end finding so that it passes this new test case
Copy link
Collaborator
@justvanrossum justvanrossum left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you!

@justvanrossum justvanrossum merged commit a017ac0 into fonttools:master Aug 1, 2019
@baileyparker baileyparker deleted the fix_t1_eexec_end_parsing branch August 1, 2019 05:17
@baileyparker
Copy link
Contributor Author

Thanks for addressing this so quickly 😁

@justvanrossum
Copy link
Collaborator

Thanks for your contribution! 👍

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.

2 participants
0