-
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
[TrueType] Recover from a missing "glyf" table by replacing it with dummy data, utilizing the existing code in sanitizeGlyphLocations
#6848
[TrueType] Recover from a missing "glyf" table by replacing it with dummy data, utilizing the existing code in sanitizeGlyphLocations
#6848
Conversation
This looks like a good solution to me. I can confirm that the three mentioned issues are resolved with this PR. I think that if we are able to recover from bad data that we certainly should make an effort to do so. I'll leave the final decision for @yurydelendik or @brendandahl, but with a reduced test case added you have my blessing for this! |
This fix seems good to me. A reduced text selection test case would be nice. |
…ummy data, utilizing the existing code in `sanitizeGlyphLocations` It seems to be fairly common for OCR software to include incomplete TrueType fonts, notable missing the "glyf" table, in PDF files. Since we currently reject such fonts, the result is that text-selection/copying is broken. This patch contains a suggested approach to try and use these kind of broken fonts, by using existing code in `sanitizeGlyphLocations` to replace a missing "glyf" table with dummy data. Fixes 4684. Fixes 6007. Fixes 6829.
A reduced /botio test |
/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/a021431e6d26a7c/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/a021431e6d26a7c/output.txt Total script time: 0.82 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/fb0e31cd08b0e6d/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/e26e8021c0701b5/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/fb0e31cd08b0e6d/output.txt Total script time: 20.86 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/e26e8021c0701b5/output.txt Total script time: 21.33 mins
|
/botio makeref |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/8e8ee169c798263/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/8db9e8cf2094110/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/8db9e8cf2094110/output.txt Total script time: 21.17 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/8e8ee169c798263/output.txt Total script time: 21.19 mins
|
[TrueType] Recover from a missing "glyf" table by replacing it with dummy data, utilizing the existing code in `sanitizeGlyphLocations`
Thank you for patching this! |
It seems to be fairly common for OCR software to include incomplete TrueType fonts, notable missing the "glyf" table, in PDF files. Since we currently reject such fonts, the result is that text-selection/copying is broken.
This patch contains a suggested approach to try and use these kind of broken fonts, by using existing code in
sanitizeGlyphLocations
to replace a missing "glyf" table with dummy data.Please note: Given that I'm not sure if we actually want to do this, I didn't want to waste time creating a reduced test-case. If this patch is deemed acceptable, I'll be happy to add a test.Fixes #4684.
Fixes #6007.
Fixes #6829.