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

Only fallback to checking properties.widths for composite fonts with IdentityToUnicodeMaps in the hasGlyph helper function (issue 8570, issue 8255) #8572

Closed
wants to merge 1 commit into from

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Jun 24, 2017

Please note: The commit message was updated to mention that the patch fixes two open issues, however no functional code changes were made!

For IdentityToUnicodeMaps it doesn't make much sense to check if a particular charCode exists in the toUnicode map, since it includes all of them by design.

However, completely ignoring missing glyphs for fonts with IdentityToUnicodeMaps caused glyph mapping issues in practice, so PR #5990 added a heuristic to instead check if a width entry existed for the glyph.
The intention of that PR was that it should apply to IdentityToUnicodeMaps, but given how the code was (and still is) written it ended up applying to all composite fonts instead.
This thus causes us to needlessly map a lot of glyphs, which since they are not found in the toUnicode map, results in us trying to move more glyphs than can actually fit into the Private Use Area. Hence why we end up with glyphs that fail to render successfully.

Hopefully we've got sufficient test coverage for this code!
As usual, I've successfully run all unit/font/reference tests locally with this patch.

Fixes #8570.
Fixes #8255.

@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/1ec23bb57e77871/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/975b635d118c4d4/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/1ec23bb57e77871/output.txt

Total script time: 16.39 mins

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/975b635d118c4d4/output.txt

Total script time: 29.98 mins

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

…h `IdentityToUnicodeMap`s in the `hasGlyph` helper function (issue 8570, issue 8255)

For `IdentityToUnicodeMap`s it doesn't make much sense to check if a particular `charCode` exists in the `toUnicode` map, since it includes all of them by design.

However, completely ignoring missing glyphs for fonts with `IdentityToUnicodeMap`s caused glyph mapping issues in practice, so PR 5990 added a heuristic to instead check if a `width` entry existed for the glyph.
The intention of that PR was that it should apply to `IdentityToUnicodeMap`s, but given how the code was (and still is) written it ended up applying to all composite fonts instead.
This thus causes us to needlessly map a lot of glyphs, which since they are not found in the `toUnicode` map, results in us trying to move more glyphs than can actually fit into the Private Use Area. Hence why we end up with glyphs that fail to render successfully.

*Hopefully we've got sufficient test coverage for this code!*
As usual, I've successfully run all unit/font/reference tests locally with this patch.

Fixes 8570.
Fixes 8255.
@Snuffleupagus Snuffleupagus changed the title Only fallback to checking properties.widths for composite font with IdentityToUnicodeMaps in the hasGlyph helper function (issue 8570) Only fallback to checking properties.widths for composite fonts with IdentityToUnicodeMaps in the hasGlyph helper function (issue 8570, issue 8255) Jun 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants