From 8c5d33c86b478d6c7e27fedccc5c16411e269f58 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Thu, 29 Mar 2012 15:37:40 -0700 Subject: [PATCH 1/2] Fix cff regression. --- src/fonts.js | 10 ++++++---- test/pdfs/issue1422.pdf.link | 1 + test/test_manifest.json | 8 ++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 test/pdfs/issue1422.pdf.link diff --git a/src/fonts.js b/src/fonts.js index b756ff2e..96fb7fab 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -4362,16 +4362,18 @@ var CFFCompiler = (function CFFCompilerClosure() { output.add(charStrings); if (cff.isCIDFont) { + // For some reason FDSelect must be in front of FDArray on windows. OSX + // and linux don't seem to care. + topDictTracker.setEntryLocation('FDSelect', [output.length], output); + var fdSelect = this.compileFDSelect(cff.fdSelect.raw); + output.add(fdSelect); + var compiled = this.compileTopDicts(cff.fdArray, output.length); topDictTracker.setEntryLocation('FDArray', [output.length], output); output.add(compiled.output); var fontDictTrackers = compiled.trackers; this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); - - topDictTracker.setEntryLocation('FDSelect', [output.length], output); - var fdSelect = this.compileFDSelect(cff.fdSelect.raw); - output.add(fdSelect); } this.compilePrivateDicts([cff.topDict], [topDictTracker], output); diff --git a/test/pdfs/issue1422.pdf.link b/test/pdfs/issue1422.pdf.link new file mode 100644 index 00000000..9f2ba3d4 --- /dev/null +++ b/test/pdfs/issue1422.pdf.link @@ -0,0 +1 @@ +http://www.cpi.si/files/cpi/userfiles/TrajnostniRazvoj/06_Prosti_cas.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index a4c6defc..6459834c 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -558,5 +558,13 @@ "rounds": 1, "link": true, "type": "eq" + }, + { "id": "issue1422", + "file": "pdfs/issue1422.pdf", + "md5": "f7a732a86960b330b8108d5cdece19e3", + "rounds": 1, + "pageLimit": 1, + "link": true, + "type": "eq" } ] From b6d23ac9dc0215306918627165b6dbd72f6f2549 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Fri, 30 Mar 2012 09:12:46 -0700 Subject: [PATCH 2/2] Remove test case, already covered. --- test/pdfs/issue1422.pdf.link | 1 - test/test_manifest.json | 8 -------- 2 files changed, 9 deletions(-) delete mode 100644 test/pdfs/issue1422.pdf.link diff --git a/test/pdfs/issue1422.pdf.link b/test/pdfs/issue1422.pdf.link deleted file mode 100644 index 9f2ba3d4..00000000 --- a/test/pdfs/issue1422.pdf.link +++ /dev/null @@ -1 +0,0 @@ -http://www.cpi.si/files/cpi/userfiles/TrajnostniRazvoj/06_Prosti_cas.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index 6459834c..a4c6defc 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -558,13 +558,5 @@ "rounds": 1, "link": true, "type": "eq" - }, - { "id": "issue1422", - "file": "pdfs/issue1422.pdf", - "md5": "f7a732a86960b330b8108d5cdece19e3", - "rounds": 1, - "pageLimit": 1, - "link": true, - "type": "eq" } ]