-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Try to skip mapping of missing TrueType and CIDFontType2 glyphs #5651
Conversation
Also don't skip mapping of glyphs which are empty, if the corresponding charCode is included in toUnicode.
Also don't skip mapping of glyphs which are empty, if the corresponding charCode is included in toUnicode.
/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/911d81633ed99c6/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/caafc54b6760116/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/caafc54b6760116/output.txt Total script time: 17.18 mins
|
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/911d81633ed99c6/output.txt Total script time: 22.83 mins
Image differences available at: http://107.21.233.14:8877/911d81633ed99c6/reftest-analyzer.html#web=eq.log |
As far as I'm concerned, the test "failures" on Linux seem to be of two kinds:
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/1b8403e2d59c565/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/1b8403e2d59c565/output.txt Total script time: 0.78 mins Published |
/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/5db5a6c21ccd59b/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/5030d99b13f6477/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/5db5a6c21ccd59b/output.txt Total script time: 17.13 mins
|
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/5030d99b13f6477/output.txt Total script time: 22.78 mins
Image differences available at: http://107.21.233.14:8877/5030d99b13f6477/reftest-analyzer.html#web=eq.log |
/botio makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @brendandahl received. Current queue size: 0 Live output at: http://107.22.172.223:8877/46f4236638338ee/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @brendandahl received. Current queue size: 0 Live output at: http://107.21.233.14:8877/8e408b14ac2a1b9/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/46f4236638338ee/output.txt Total script time: 17.17 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/8e408b14ac2a1b9/output.txt Total script time: 22.59 mins
|
Try to skip mapping of missing TrueType and CIDFontType2 glyphs
Thanks for picking this up! |
Try to skip mapping of missing TrueType and CIDFontType2 glyphs
This PR is based on a patch written by @brendandahl.
The first patch fixed most of the issues, and needed only a very minor adjustment to work correctly for fonts with a
CIDToGIDMap
.However in some browsers (e.g. the release version of Firefox), the first patch caused a lot of
notdef
glyphs to appear in a number of the test files.After quite a bit of debugging, I found that this was usually an issue with the way that the
space
character was mapped. In the problematic PDF files,space
was usually mapped to various (low) control charCodes.Since the
space
glyph (obviously) doesn't need any glyph data, and is thus empty, this causes it to be added tomissingGlyphs
bysanitizeGlyphLocations()
.To work around this, I'm proposing that we also look at
toUnicode
when building thecharCodeToGlyphId
map. If the charCode exists intoUnicode
the glyph is most likely needed, even if it's empty, hence we add it to thecharCodeToGlyphId
map. This letsadjustMapping()
, if necessary, move the charCode to the Private Use Area and thus fixing the issues withnotdef
being displayed.I hope that this approach is reasonable (it passes all tests locally)!
Fixes #5202.
Fixes #5584.
Fixes #3652.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1122998.
Fixes #5664.
Fixes #5681.
Fixes #5704.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=893730.