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

Take the FirstChar/LastChar properties into account when computing the hash in PartialEvaluator.preEvaluateFont (issue 10665) #10685

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

Without this some fonts may incorrectly end up with matching hashes, thus breaking rendering since we'll not actually try to load/parse some of the fonts.

Fixes #10665.

…atedFonts` in `PartialEvaluator.loadFont`

Note that `PartialEvaluator.preEvaluateFont` will return an empty string when no hash was computed. This will complete short-circuit the `fontAlias` comparison in `PartialEvaluator.loadFont`, since fonts which are totally different will then match if their `hash`es are empty.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@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/ff112ed912299cf/output.txt

@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/de37a56625116ff/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

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

Total script time: 18.46 mins

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

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

Total script time: 25.57 mins

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

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

…g the hash in `PartialEvaluator.preEvaluateFont` (issue 10665)

Without this some fonts may incorrectly end up with matching `hash`es, thus breaking rendering since we'll not actually try to load/parse some of the fonts.
@@ -2352,6 +2350,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
}
}

const firstChar = (dict.get('FirstChar') || 0);
const lastChar = (dict.get('LastChar') || (composite ? 0xFFFF : 0xFF));
hash.update(`${firstChar}-${lastChar}`);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The updated patch only changed the separator here, since using the same one (i.e. comma) as in the 'Differences' array case above may perhaps not be the best idea.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/5251367b63df86a/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/5251367b63df86a/output.txt

Total script time: 1.86 mins

Published

@timvandermeij timvandermeij merged commit a63de0e into mozilla:master Mar 27, 2019
@timvandermeij
Copy link
Contributor

Thank you! I'll make reference images in the other PR to save resources.

@Snuffleupagus Snuffleupagus deleted the preEvaluateFont-better-hashing branch March 27, 2019 23:49
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.

3 participants