-
Notifications
You must be signed in to change notification settings - Fork 10k
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 draw glyphs on canvas if they are in the font or the font file is missing. #7023
Conversation
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.22.172.223:8877/96bde2b0a1f2ca5/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.21.233.14:8877/7ff619c0548d387/output.txt |
@@ -2836,7 +2840,7 @@ var Font = (function FontClosure() { | |||
!glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, | |||
operatorListId, isSpace)) { |
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.
Don't you need to add isInFont
here as well (and also update the comparison in Glyph.prototype.matchesForCache
)?
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/7ff619c0548d387/output.txt Total script time: 22.13 mins
|
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/96bde2b0a1f2ca5/output.txt Total script time: 22.63 mins
Image differences available at: http://107.22.172.223:8877/96bde2b0a1f2ca5/reftest-analyzer.html#web=eq.log |
r=me, with the comment addressed and passing test runs. |
Good catch |
From: Bot.io (Linux)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.21.233.14:8877/61396c6a8aa0ef6/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://107.22.172.223:8877/96df55a6f8da6af/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/96df55a6f8da6af/output.txt Total script time: 20.16 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/61396c6a8aa0ef6/output.txt Total script time: 21.81 mins
|
I have a fix for this I think, will do in another PR though. |
/botio makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @brendandahl received. Current queue size: 1 Live output at: http://107.22.172.223:8877/4d06ef86191a175/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @brendandahl received. Current queue size: 1 Live output at: http://107.21.233.14:8877/c73a9a8dd38006f/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/4d06ef86191a175/output.txt Total script time: 20.06 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/c73a9a8dd38006f/output.txt Total script time: 21.29 mins
|
Only draw glyphs on canvas if they are in the font or the font file is missing.
This bug is similar to the canvas bug of mozilla#6721. I found this bug when I tried to run pdf2svg on a SVG file, and the generated SVG could not be viewed in Chrome due to a SVG/XML parsing error: "PCDATA invalid Char value 3" Reduced test case: - https://github.com/mozilla/pdf.js/files/1229507/pcdatainvalidchar.pdf - expected: "hardware performance" - Actual SVG source: "hardware\x03performance" (where "\x03" is a non-printable character, and invalid XML). In terms of rendering, this bug is similar to mozilla#6721, where an unexpected glyph appeared in the canvas renderer. This was fixed by mozilla#7023, which skips over missing glyphs. This commit follows a similar logic. The test case from mozilla#6721 can be used here too: - https://github.com/mozilla/pdf.js/files/52205/issue6721_reduced.pdf expected: "Issue 6721" actual (before this patch): "Issue ààà6721"
This bug is similar to the canvas bug of mozilla#6721. I found this bug when I tried to run pdf2svg on a SVG file, and the generated SVG could not be viewed in Chrome due to a SVG/XML parsing error: "PCDATA invalid Char value 3" Reduced test case: - https://github.com/mozilla/pdf.js/files/1229507/pcdatainvalidchar.pdf - expected: "hardware performance" - Actual SVG source: "hardware\x03performance" (where "\x03" is a non-printable character, and invalid XML). In terms of rendering, this bug is similar to mozilla#6721, where an unexpected glyph appeared in the canvas renderer. This was fixed by mozilla#7023, which skips over missing glyphs. This commit follows a similar logic. The test case from mozilla#6721 can be used here too: - https://github.com/mozilla/pdf.js/files/52205/issue6721_reduced.pdf expected: "Issue 6721" actual (before this patch): "Issue ààà6721"
This bug is similar to the canvas bug of mozilla#6721. I found this bug when I tried to run pdf2svg on a SVG file, and the generated SVG could not be viewed in Chrome due to a SVG/XML parsing error: "PCDATA invalid Char value 3" Reduced test case: - https://github.com/mozilla/pdf.js/files/1229507/pcdatainvalidchar.pdf - expected: "hardware performance" - Actual SVG source: "hardware\x03performance" (where "\x03" is a non-printable character, and invalid XML). In terms of rendering, this bug is similar to mozilla#6721, where an unexpected glyph appeared in the canvas renderer. This was fixed by mozilla#7023, which skips over missing glyphs. This commit follows a similar logic. The test case from mozilla#6721 can be used here too: - https://github.com/mozilla/pdf.js/files/52205/issue6721_reduced.pdf expected: "Issue 6721" actual (before this patch): "Issue ààà6721"
Fixes #6721
I could have sworn there were more PDF's with this issue, but I'm not finding any.