diff --git a/src/core/fonts.js b/src/core/fonts.js index e838341af..2c9ffa94e 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -689,12 +689,17 @@ var Font = (function FontClosure() { } // Some fonts might use wrong font types for Type1C or CIDFontType0C - if (subtype === 'Type1C' && (type !== 'Type1' && type !== 'MMType1')) { - // Some TrueType fonts by mistake claim Type1C - if (isTrueTypeFile(file)) { - subtype = 'TrueType'; - } else { - type = 'Type1'; + if (subtype === 'Type1C') { + if (type !== 'Type1' && type !== 'MMType1') { + // Some TrueType fonts by mistake claim Type1C + if (isTrueTypeFile(file)) { + subtype = 'TrueType'; + } else { + type = 'Type1'; + } + } else if (isOpenTypeFile(file)) { + // Sometimes the type/subtype can be a complete lie (see issue7598.pdf). + type = subtype = 'OpenType'; } } if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') { diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 72c0ca28c..06486ca08 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -35,6 +35,7 @@ !issue7439.pdf !issue7446.pdf !issue7492.pdf +!issue7598.pdf !filled-background.pdf !ArabicCIDTrueType.pdf !ThuluthFeatures.pdf diff --git a/test/pdfs/issue7598.pdf b/test/pdfs/issue7598.pdf new file mode 100644 index 000000000..d4e11bd35 Binary files /dev/null and b/test/pdfs/issue7598.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 493e04666..d1b2d613f 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -1795,6 +1795,13 @@ "link": false, "type": "eq" }, + { "id": "issue7598", + "file": "pdfs/issue7598.pdf", + "md5": "c5bc5a779bfcb4b234f853231b56cf60", + "rounds": 1, + "link": false, + "type": "eq" + }, { "id": "issue7439", "file": "pdfs/issue7439.pdf", "md5": "56682657990a894c66db26560d3039d7",