-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Fix the charCodeOf
method in IdentityToUnicodeMap
in order to prevent text selection from breaking
#6725
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
Fix the charCodeOf
method in IdentityToUnicodeMap
in order to prevent text selection from breaking
#6725
Conversation
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/0b770b57fa2ea0c/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/cc80bec50ea9f4f/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/cc80bec50ea9f4f/output.txt Total script time: 19.12 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/0b770b57fa2ea0c/output.txt Total script time: 20.42 mins
|
…vent text selection from breaking After PR 6590, `font.spaceWidth` is now called in more cases than before (in `PartialEvaluator_getTextContent`), which exposed an underlying issue with `IdentityToUnicodeMap_charCodeOf` throwing an error. This breaks text-selection in some PDF files found in the wild, hence this patch replaces the `error` with an actual function instead (modelled after `IdentityCMap_charCodeOf`).
charCodeAt
method in IdentityToUnicodeMap
in order to prevent text selection from breakingcharCodeOf
method in IdentityToUnicodeMap
in order to prevent text selection from breaking
Looks good, thank you. /botio makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/a4bc70c6129e968/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/f77e1905079fd0e/output.txt |
…CodeOf Fix the `charCodeOf` method in `IdentityToUnicodeMap` in order to prevent text selection from breaking
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/a4bc70c6129e968/output.txt Total script time: 19.11 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/f77e1905079fd0e/output.txt Total script time: 20.41 mins
|
After PR #6590,
font.spaceWidth
is now called in more cases than before (inPartialEvaluator_getTextContent
), which exposed an underlying issue withIdentityToUnicodeMap_charCodeOf
throwing an error.This breaks text-selection in some PDF files found in the wild, hence this patch replaces the
error
with an actual function instead (modelled afterIdentityCMap_charCodeOf
).Edit: An example is the PDF file in https://bugzilla.mozilla.org/show_bug.cgi?id=1020380.
Edit2: Pushed a new version that only updates the commit message, to fix the stupid
charCodeAt
->charCodeOf
typo.