diff --git a/lib/pdffont.js b/lib/pdffont.js index 99591048..f54e9b27 100644 --- a/lib/pdffont.js +++ b/lib/pdffont.js @@ -215,6 +215,15 @@ let PDFFont = (function PFPFontClosure() { this.bold = this.typeName.indexOf("bold") >= 0 || this.typeName.indexOf("black") >= 0; } this.italic = fontObj.italic; // fix https://github.com/modesty/pdf2json/issues/42 + // Extended the fix for https://github.com/modesty/pdf2json/issues/42 + if (!this.italic) { + this.italic = this.typeName.indexOf("italic") >= 0 || this.typeName.indexOf("oblique") >= 0; + } + // Added detection of hybrid dual bolditalic fonts + if (((!this.bold) || (!this.italic)) && (this.typeName.indexOf("boldobl") >= 0)) { + this.bold = true; + this.italic = true; + } let typeName = this.subType; if (fontObj.isSerifFont) { @@ -382,4 +391,3 @@ let PDFFont = (function PFPFontClosure() { })(); module.exports = PDFFont; -