Merge pull request #11660 from janpe2/type1notdef
Fix Type1 font parsing when .notdef is not at index zero
This commit is contained in:
commit
b56e058b4b
@ -679,13 +679,19 @@ var Type1Parser = (function Type1ParserClosure() {
|
|||||||
// here and put an endchar to make the validator happy.
|
// here and put an endchar to make the validator happy.
|
||||||
output = [14];
|
output = [14];
|
||||||
}
|
}
|
||||||
program.charstrings.push({
|
const charStringObject = {
|
||||||
glyphName: glyph,
|
glyphName: glyph,
|
||||||
charstring: output,
|
charstring: output,
|
||||||
width: charString.width,
|
width: charString.width,
|
||||||
lsb: charString.lsb,
|
lsb: charString.lsb,
|
||||||
seac: charString.seac,
|
seac: charString.seac,
|
||||||
});
|
};
|
||||||
|
if (glyph === ".notdef") {
|
||||||
|
// Make sure .notdef is at index zero (issue #11477).
|
||||||
|
program.charstrings.unshift(charStringObject);
|
||||||
|
} else {
|
||||||
|
program.charstrings.push(charStringObject);
|
||||||
|
}
|
||||||
|
|
||||||
// Attempt to replace missing widths, from the font dictionary /Widths
|
// Attempt to replace missing widths, from the font dictionary /Widths
|
||||||
// entry, with ones from the font data (fixes issue11150_reduced.pdf).
|
// entry, with ones from the font data (fixes issue11150_reduced.pdf).
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -299,6 +299,7 @@
|
|||||||
!issue4573.pdf
|
!issue4573.pdf
|
||||||
!issue4722.pdf
|
!issue4722.pdf
|
||||||
!issue4800.pdf
|
!issue4800.pdf
|
||||||
|
!issue11477_reduced.pdf
|
||||||
!text_clip_cff_cid.pdf
|
!text_clip_cff_cid.pdf
|
||||||
!issue4801.pdf
|
!issue4801.pdf
|
||||||
!issue5334.pdf
|
!issue5334.pdf
|
||||||
|
BIN
test/pdfs/issue11477_reduced.pdf
Normal file
BIN
test/pdfs/issue11477_reduced.pdf
Normal file
Binary file not shown.
@ -1456,6 +1456,12 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue11477",
|
||||||
|
"file": "pdfs/issue11477_reduced.pdf",
|
||||||
|
"md5": "f4e5735569afce79e52b3fd56d10ae13",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue7665",
|
{ "id": "issue7665",
|
||||||
"file": "pdfs/issue7665.pdf",
|
"file": "pdfs/issue7665.pdf",
|
||||||
"md5": "f1199d16195a61e8232e2d1e742ed46b",
|
"md5": "f1199d16195a61e8232e2d1e742ed46b",
|
||||||
|
Loading…
Reference in New Issue
Block a user