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

For Type1 fonts, replace missing font dictionary /Widths entries with ones from the font data (issue 11150)

Hopefully this patch makes sense, and in order to reduce the regression risk the implementation ensures that only completely missing widths are being replaced.
This commit is contained in:
Jonas Jenwald 2019-09-18 09:44:18 +02:00
parent d7c7f15551
commit af22dc9b0c
6 changed files with 21 additions and 3 deletions

View file

@ -82,6 +82,7 @@
!issue10665_reduced.pdf
!issue11016_reduced.pdf
!issue11045.pdf
!issue11150_reduced.pdf
!bad-PageLabels.pdf
!decodeACSuccessive.pdf
!filled-background.pdf

Binary file not shown.

View file

@ -53,6 +53,13 @@
"link": false,
"type": "text"
},
{ "id": "issue11150",
"file": "pdfs/issue11150_reduced.pdf",
"md5": "8b86381089a9ec28723791245a9adfa6",
"rounds": 1,
"link": false,
"type": "eq"
},
{ "id": "issue1293",
"file": "pdfs/issue1293r.pdf",
"md5": "4a098f5051f34fab036f5bbe88f8deef",

View file

@ -90,7 +90,7 @@ describe('Type1Parser', function() {
'/.notdef 1 RD x ND\n' +
'end');
var parser = new Type1Parser(stream, false, SEAC_ANALYSIS_ENABLED);
var program = parser.extractFontProgram();
var program = parser.extractFontProgram({});
expect(program.charstrings.length).toEqual(1);
expect(program.properties.privateData.ExpansionFactor).toEqual(99);
});