Merge pull request #7639 from Snuffleupagus/bug-1252420
Replace empty CharStrings with '.notdef' in `Type1Font_wrap` to prevent OTS from rejecting the font (bug 1252420)
This commit is contained in:
commit
15e1ae4e3f
@ -3296,7 +3296,14 @@ var Type1Font = (function Type1FontClosure() {
|
||||
var charStringsIndex = new CFFIndex();
|
||||
charStringsIndex.add([0x8B, 0x0E]); // .notdef
|
||||
for (i = 0; i < count; i++) {
|
||||
charStringsIndex.add(glyphs[i]);
|
||||
var glyph = glyphs[i];
|
||||
// If the CharString outline is empty, replace it with .notdef to
|
||||
// prevent OTS from rejecting the font (fixes bug1252420.pdf).
|
||||
if (glyph.length === 0) {
|
||||
charStringsIndex.add([0x8B, 0x0E]); // .notdef
|
||||
continue;
|
||||
}
|
||||
charStringsIndex.add(glyph);
|
||||
}
|
||||
cff.charStrings = charStringsIndex;
|
||||
|
||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -51,6 +51,7 @@
|
||||
!bug1200096.pdf
|
||||
!bug1068432.pdf
|
||||
!bug1146106.pdf
|
||||
!bug1252420.pdf
|
||||
!issue5564_reduced.pdf
|
||||
!canvas.pdf
|
||||
!bug1132849.pdf
|
||||
|
BIN
test/pdfs/bug1252420.pdf
Normal file
BIN
test/pdfs/bug1252420.pdf
Normal file
Binary file not shown.
@ -776,6 +776,13 @@
|
||||
"link": false,
|
||||
"type": "load"
|
||||
},
|
||||
{ "id": "bug1252420",
|
||||
"file": "pdfs/bug1252420.pdf",
|
||||
"md5": "f21c911b9b655972b06ef782a1fa6a17",
|
||||
"rounds": 1,
|
||||
"link": false,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "hudsonsurvey",
|
||||
"file": "pdfs/hudsonsurvey.pdf",
|
||||
"md5": "bf0e6576a7b6c2fe7485bce1b78e006f",
|
||||
|
Loading…
Reference in New Issue
Block a user