-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Prevent trying to map characters to the specials unicode block in adjustMapping (issue 4650) #4701
Conversation
I can confirm that this fixes the issue for me. |
@@ -2446,6 +2446,11 @@ var Font = (function FontClosure() { | |||
// TODO: Try to map ligatures to the correct spot. | |||
if (unicode.length === 1) { | |||
fontCharCode = unicode.charCodeAt(0); | |||
|
|||
// Prevent drawing characters in the specials unicode block. | |||
if (fontCharCode >= 0xFFF0 && fontCharCode <= 0xFFFF) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will it make sense to move that 10 lines below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will obviously work too (just ran the tests to confirm), furthermore it might also prevent other issues in the future.
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/861d902555c6906/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/861d902555c6906/output.txt Total script time: 0.38 mins Published
|
…ustMapping (issue 4650)
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/2f6d13aafbf1415/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/9f5b8f8ac3e6663/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/2f6d13aafbf1415/output.txt Total script time: 2.67 mins
Image differences available at: http://107.22.172.223:8877/2f6d13aafbf1415/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/9f5b8f8ac3e6663/output.txt Total script time: 25.87 mins
|
/botio-windows test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/507c0c6e7302420/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/507c0c6e7302420/output.txt Total script time: 22.15 mins
|
/botio makeref |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/a7340f27a720a06/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/39a0338743633e6/output.txt |
Thank you for the patch |
Prevent trying to map characters to the specials unicode block in adjustMapping (issue 4650)
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/39a0338743633e6/output.txt Total script time: 22.45 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/a7340f27a720a06/output.txt Total script time: 25.91 mins
|
Attempting to fix #4650.
In the PDF file in the issue a lot of the fonts have bogus
ToUnicode
dictionaries where all chars point to0xFFFD
, i.e. inside the specials Unicode block[0xFFF0, 0xFFFF]
. (This should also explain why even Adobe Reader is unable to copy most of the text in the document)Given that we currently ignore the specials Unicode block in other places (e.g. in
mapSpecialUnicodeValues
, fonts.js#L503-L505), it seemed reasonable to do the same thing here.@yurydelendik In #4671 (comment) you said that it was my turn to fix a font bug, so I've tried! :-D
Does this PR seem reasonable? If so, should I attach a test file?