]> git.parisson.com Git - pdf.js.git/commitdiff
Fixing "no spaces" issue (ref #577)
authornotmasteryet <async.processingjs@yahoo.com>
Sun, 2 Oct 2011 02:24:11 +0000 (21:24 -0500)
committernotmasteryet <async.processingjs@yahoo.com>
Sun, 2 Oct 2011 02:24:11 +0000 (21:24 -0500)
pdf.js
test/pdfs/unix01.pdf.link [new file with mode: 0644]
test/test_manifest.json

diff --git a/pdf.js b/pdf.js
index 4ed2db6c1ae628e1a918ae8b7d4b264341a6fa09..3eb1f5f96055134929cea244b7dd4928ae4dedd9 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -4573,11 +4573,10 @@ var PartialEvaluator = (function partialEvaluator() {
       var glyphs = {};
       for (var i = firstChar; i <= lastChar; i++) {
         var glyph = differences[i];
+        var replaceGlyph = true;
         if (!glyph) {
           glyph = baseEncoding[i];
-          // skipping already specified by difference glyphs
-          if (differences.indexOf(glyph) >= 0)
-            continue;
+          replaceGlyph = false;
         }
         var index = GlyphsUnicode[glyph] || i;
         var width = widths[i] || widths[glyph];
@@ -4586,8 +4585,10 @@ var PartialEvaluator = (function partialEvaluator() {
           width: isNum(width) ? width : properties.defaultWidth
         };
 
-        if (glyph)
-          glyphs[glyph] = map[i];
+        if (glyph) {
+          if (replaceGlyph || !glyphs[glyph])
+            glyphs[glyph] = map[i];
+        }
 
         // If there is no file, the character mapping can't be modified
         // but this is unlikely that there is any standard encoding with
diff --git a/test/pdfs/unix01.pdf.link b/test/pdfs/unix01.pdf.link
new file mode 100644 (file)
index 0000000..f8ad05e
--- /dev/null
@@ -0,0 +1 @@
+https://docs.rice.edu/confluence/download/attachments/4588376/unix01.pdf?version=1
index 71738f1924e18e500be9712043dfc2ebd8e35d72..79e88c5906fb36c791cb015412736ea18e6b839c 100644 (file)
        "rounds": 1,
        "type": "eq"
     },
+    {  "id": "unix01",
+       "file": "pdfs/unix01.pdf",
+       "link": true,
+       "rounds": 1,
+       "type": "eq"
+    },
     {  "id": "fips197",
        "file": "pdfs/fips197.pdf",
        "link": true,