From 808ca828f1d9262c9e0bb7ca45571b7d4abb8468 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 30 Jan 2023 12:04:10 +0100 Subject: [PATCH] Extend `getGlyphMapForStandardFonts` with additional entries (issue 15977) --- src/core/standard_fonts.js | 1 + test/pdfs/.gitignore | 1 + test/pdfs/issue15977_reduced.pdf | 102 +++++++++++++++++++++++++++++++ test/test_manifest.json | 6 ++ 4 files changed, 110 insertions(+) create mode 100644 test/pdfs/issue15977_reduced.pdf diff --git a/src/core/standard_fonts.js b/src/core/standard_fonts.js index cd2b93228..977d4c0ab 100644 --- a/src/core/standard_fonts.js +++ b/src/core/standard_fonts.js @@ -488,6 +488,7 @@ const getGlyphMapForStandardFonts = getLookupTableFactory(function (t) { t[182] = 8217; t[200] = 193; t[203] = 205; + t[207] = 211; t[210] = 218; t[223] = 711; t[224] = 321; diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index d69ba9659..2282a3811 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -271,6 +271,7 @@ !issue4379.pdf !issue4550.pdf !issue13316_reduced.pdf +!issue15977_reduced.pdf !issue4575.pdf !bug1011159.pdf !issue5734.pdf diff --git a/test/pdfs/issue15977_reduced.pdf b/test/pdfs/issue15977_reduced.pdf new file mode 100644 index 000000000..6377403b4 --- /dev/null +++ b/test/pdfs/issue15977_reduced.pdf @@ -0,0 +1,102 @@ +%PDF-1.7 +45 0 obj +<< +/Type /Catalog +/Pages 46 0 R +>> +endobj +46 0 obj +<< +/Type /Pages +/MediaBox [ 0 0 200 50 ] +/Count 1 +/Kids [ 47 0 R ] +>> +endobj +47 0 obj +<< +/Type /Page +/Parent 46 0 R +/Resources << +/Font << +/F1 48 0 R +>> +>> +/Contents 49 0 R +>> +endobj +48 0 obj +<< +/Type /Font +/Subtype /Type0 +/BaseFont /Arial +/Encoding /Identity-H +/DescendantFonts [ 12 0 R ] +>> +endobj +49 0 obj +<< +/Length 79 +>> +stream +BT +10 20 TD +/F1 20 Tf +<003500280026003200300028002700240026002c00cf0031> Tj +ET + +endstream + +endobj +12 0 obj +<< +/Type /Font +/Subtype /CIDFontType2 +/BaseFont /Arial +/CIDSystemInfo << +/Registry (Adobe) +/Ordering (Identity) +/Supplement 0 +>> +/W [ 3 [ 277.832 ] 11 [ 333.008 ] 12 [ 333.008 ] 16 [ 333.008 ] 17 [ 277.832 ] 18 [ 277.832 ] 19 [ 556.152 ] 20 [ 556.152 ] 21 [ 556.152 ] 23 [ 556.152 ] 24 [ 556.152 ] 25 [ 556.152 ] 29 [ 277.832 ] 36 [ 666.992 ] 37 [ 666.992 ] 38 [ 722.168 ] 39 [ 722.168 ] 40 [ 666.992 ] 42 [ 777.832 ] 44 [ 277.832 ] 46 [ 666.992 ] 47 [ 556.152 ] 48 [ 833.008 ] 49 [ 722.168 ] 50 [ 777.832 ] 51 [ 666.992 ] 53 [ 722.168 ] 55 [ 610.84 ] 57 [ 666.992 ] 68 [ 556.152 ] 71 [ 556.152 ] 72 [ 556.152 ] 74 [ 556.152 ] 76 [ 222.168 ] 81 [ 556.152 ] 105 [ 556.152 ] 207 [ 777.832 ] ] +/FontDescriptor 13 0 R +>> +endobj +13 0 obj +<< +/Type /FontDescriptor +/Ascent 728 +/CapHeight 0 +/Descent -210 +/Flags 32 +/FontBBox [ -665 -325 2000 1040 ] +/FontName /Arial +/ItalicAngle 0 +/StemV 0 +>> +endobj +xref +0 1 +0000000000 65535 f +12 1 +0000000500 00000 n +13 1 +0000001233 00000 n +45 1 +0000000009 00000 n +46 1 +0000000060 00000 n +47 1 +0000000146 00000 n +48 1 +0000000252 00000 n +49 1 +0000000369 00000 n +trailer +<< +/Size 7 +/Root 45 0 R +>> +startxref +1401 +%%EOF \ No newline at end of file diff --git a/test/test_manifest.json b/test/test_manifest.json index 95bfd0141..173061a9b 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -2235,6 +2235,12 @@ "rounds": 1, "type": "eq" }, + { "id": "issue15977", + "file": "pdfs/issue15977_reduced.pdf", + "md5": "cd06accb3da81597ad11acffeb0b68fc", + "rounds": 1, + "type": "eq" + }, { "id": "issue5084", "file": "pdfs/issue5084.pdf", "md5": "a42a076ba90e20e3aae9af869eb4de45",