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

Create the glyph mapping correctly for composite Type1, i.e. CIDFontType0, fonts (issue 11740) #11746

Merged
merged 3 commits into from
Apr 6, 2020

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Mar 25, 2020

Please refer to the individual commit messages.

Fixes #11740

@Snuffleupagus Snuffleupagus changed the title Issue 11740 Always use a custom built-in encoding in Type1 fonts, regardless of the font flags, when building the charCode to glyph mapping (issue 11740) Mar 25, 2020
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/72a8104410c9517/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/72a8104410c9517/output.txt

Total script time: 2.42 mins

Published

@Snuffleupagus Snuffleupagus force-pushed the issue-11740 branch 3 times, most recently from f0edc29 to f55123f Compare March 25, 2020 14:29
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/473e8c7011690a7/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/d55efbdc248cbd9/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/473e8c7011690a7/output.txt

Total script time: 19.77 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/473e8c7011690a7/reftest-analyzer.html#web=eq.log

@Snuffleupagus Snuffleupagus marked this pull request as ready for review March 25, 2020 14:58
@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/d55efbdc248cbd9/output.txt

Total script time: 60.00 mins

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/c0c381160e3a8cf/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/c14937693b1cf38/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/c0c381160e3a8cf/output.txt

Total script time: 19.80 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/c0c381160e3a8cf/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/c14937693b1cf38/output.txt

Total script time: 60.00 mins

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/a01d61666ad9aeb/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/a01d61666ad9aeb/output.txt

Total script time: 2.52 mins

Published

@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/b512ae6fa7baa94/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/b512ae6fa7baa94/output.txt

Total script time: 2.45 mins

Published

@Snuffleupagus Snuffleupagus force-pushed the issue-11740 branch 2 times, most recently from 0c7b27e to f22116d Compare March 31, 2020 09:53
@Snuffleupagus Snuffleupagus changed the title Always use a custom built-in encoding in Type1 fonts, regardless of the font flags, when building the charCode to glyph mapping (issue 11740) Create the glyph mapping correctly for composite Type1, i.e. CIDFontType0, fonts (issue 11740) Mar 31, 2020
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/55b8408a578acde/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/0a401c6d33ee62e/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/0a401c6d33ee62e/output.txt

Total script time: 1.77 mins

  • Font tests: FAILED
  • Unit tests: FAILED
  • Regression tests: FAILED

Image differences available at: http://54.215.176.217:8877/0a401c6d33ee62e/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/55b8408a578acde/output.txt

Total script time: 19.79 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/55b8408a578acde/reftest-analyzer.html#web=eq.log

…ms in `Type1Parser` (issue 11740)

The PDF document, in the referenced issue, actually contains ASCII-encoded Type1 data which we currently *incorrectly* identify as binary.

According to the specification, see https://www-cdf.fnal.gov/offline/PostScript/T1_SPEC.PDF#[{%22num%22%3A203%2C%22gen%22%3A0}%2C{%22name%22%3A%22XYZ%22}%2C87%2C452%2Cnull], the current checks are insufficient to decide between binary/ASCII encoded Type1 font programs.
…ype0, fonts (issue 11740)

This updates `Type1Font.getGlyphMapping` with a code-path "borrowed" from `CFFFont.getGlyphMapping`.
…`, slightly more efficient

By slicing the Uint8Array directly, rather than using the prototype and a `call` invocation, the runtime of `decryptAscii` is decreased slightly (~30% based on quick logging).
The `decryptAscii` function is still less efficient than `decrypt`, however ASCII encoded Type1 font programs are sufficiently rare that it probably doesn't matter much (we've only seen *two* examples, issue 4630 and 11740).
@brendandahl
Copy link
Contributor

/botio-windows test

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2020

From: Bot.io (Windows)


Received

Command cmd_test from @brendandahl received. Current queue size: 0

Live output at: http://54.215.176.217:8877/019fc2910369d7e/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2020

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/019fc2910369d7e/output.txt

Total script time: 26.18 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.215.176.217:8877/019fc2910369d7e/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit 70c54ab into mozilla:master Apr 6, 2020
@timvandermeij
Copy link
Contributor

Thank you for looking into this!

/botio makeref

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2020

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/57c4ede6e4328e8/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2020

From: Bot.io (Windows)


Received

Command cmd_makeref from @timvandermeij received. Current queue size: 1

Live output at: http://54.215.176.217:8877/574d995b1ec6a18/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2020

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/57c4ede6e4328e8/output.txt

Total script time: 18.10 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@pdfjsbot
Copy link

pdfjsbot commented Apr 6, 2020

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/574d995b1ec6a18/output.txt

Total script time: 23.37 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@Snuffleupagus Snuffleupagus deleted the issue-11740 branch April 6, 2020 22:37
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.

PDF not rendering
5 participants