diff --git a/src/core/fonts.js b/src/core/fonts.js index a2e090d61..4a18a7add 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -1108,9 +1108,10 @@ class Font { // Repair the TrueType file. It is can be damaged in the point of // view of the sanitizer data = this.checkAndRepair(name, file, properties); - if (this.isOpenType) { - adjustWidths(properties); + adjustWidths(properties); + + if (this.isOpenType) { type = "OpenType"; } break; @@ -2645,8 +2646,6 @@ class Font { cffFile = new Stream(tables["CFF "].data); cff = new CFFFont(cffFile, properties); - adjustWidths(properties); - return this.convert(name, cff, properties); } diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index a06a28688..7c631177a 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -28,6 +28,7 @@ !checkbox-bad-appearance.pdf !issue4684.pdf !issue8092.pdf +!issue19802.pdf !issue5256.pdf !issue5801.pdf !issue5946.pdf diff --git a/test/pdfs/issue19802.pdf b/test/pdfs/issue19802.pdf new file mode 100644 index 000000000..b10241ff2 Binary files /dev/null and b/test/pdfs/issue19802.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index b1950cdff..86c1d819e 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -3871,6 +3871,13 @@ "annotations": true, "about": "LinkAnnotation with a relative link, and a /Catalog Base-URI." }, + { + "id": "issue19802", + "file": "pdfs/issue19802.pdf", + "md5": "7a431fb7951ad605f676c80636bbe5d3", + "rounds": 1, + "type": "eq" + }, { "id": "issue14824", "file": "pdfs/issue14824.pdf",