diff --git a/src/core/fonts.js b/src/core/fonts.js index 6d38a0920..a3a52cf62 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -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; diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index c00a37454..cb7707886 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -51,6 +51,7 @@ !bug1200096.pdf !bug1068432.pdf !bug1146106.pdf +!bug1252420.pdf !issue5564_reduced.pdf !canvas.pdf !bug1132849.pdf diff --git a/test/pdfs/bug1252420.pdf b/test/pdfs/bug1252420.pdf new file mode 100644 index 000000000..8f01f546e Binary files /dev/null and b/test/pdfs/bug1252420.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 785daeefb..f34623bdf 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -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",