1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Fix Type1 font parsing when .notdef is not at index zero

Fixes #11477
The PDF draws many space characters but the embedded fonts don't have a glyph named `space`, so `.notdef` should be drawn instead. PDF.js assumed that Type1 fonts define `.notdef` as the first glyph (index 0). However, now the fonts have the glyph `A` at index 0 and `.notdef` is the last one, so `A` appears where spaces are expected.

Because the rest of the font machinery in `core/fonts.js` assumes `.notdef` is at index zero, it's easiest to modify `core/type1_parser.js` so that it "repairs" fonts and makes sure `.notdef` is at index 0.
This commit is contained in:
Jani Pehkonen 2020-03-03 21:55:51 +02:00
parent 52749d1f0d
commit 71e7686950
4 changed files with 15 additions and 2 deletions

View file

@ -299,6 +299,7 @@
!issue4573.pdf
!issue4722.pdf
!issue4800.pdf
!issue11477_reduced.pdf
!text_clip_cff_cid.pdf
!issue4801.pdf
!issue5334.pdf

Binary file not shown.

View file

@ -1456,6 +1456,12 @@
"rounds": 1,
"type": "eq"
},
{ "id": "issue11477",
"file": "pdfs/issue11477_reduced.pdf",
"md5": "f4e5735569afce79e52b3fd56d10ae13",
"rounds": 1,
"type": "eq"
},
{ "id": "issue7665",
"file": "pdfs/issue7665.pdf",
"md5": "f1199d16195a61e8232e2d1e742ed46b",