mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 16:48:08 +02:00
[TrueType] Recover from a missing "glyf" table by replacing it with dummy 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.
This commit is contained in:
parent
e134947533
commit
d52495a9c8
4 changed files with 19 additions and 2 deletions
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -10,6 +10,7 @@
|
|||
!issue2391-1.pdf
|
||||
!issue2391-2.pdf
|
||||
!issue4665.pdf
|
||||
!issue4684.pdf
|
||||
!issue5801.pdf
|
||||
!issue5946.pdf
|
||||
!issue5972.pdf
|
||||
|
|
BIN
test/pdfs/issue4684.pdf
Normal file
BIN
test/pdfs/issue4684.pdf
Normal file
Binary file not shown.
|
@ -1789,6 +1789,14 @@
|
|||
"type": "eq",
|
||||
"about": "Has a multi-byte char codes."
|
||||
},
|
||||
{ "id": "issue4684-text",
|
||||
"file": "pdfs/issue4684.pdf",
|
||||
"md5": "af5056fcdfb08bd7adc1710d36e4b5b5",
|
||||
"link": false,
|
||||
"rounds": 1,
|
||||
"type": "text",
|
||||
"about": "Invisible (and broken) TrueType font used for text-selection."
|
||||
},
|
||||
{ "id": "issue1912",
|
||||
"file": "pdfs/issue1912.pdf",
|
||||
"md5": "15305b7c2cba971e7423de3f6ad38fef",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue