]> git.parisson.com Git - pdf.js.git/commitdiff
fix encoding table
authorsbarman <sbarman@L3CWZ5T.(none)>
Fri, 8 Jul 2011 22:28:04 +0000 (15:28 -0700)
committersbarman <sbarman@L3CWZ5T.(none)>
Fri, 8 Jul 2011 22:28:04 +0000 (15:28 -0700)
pdf.js

diff --git a/pdf.js b/pdf.js
index eef6deed54fb36381065a9bffbd4a3a6fa4a2c04..c14213eb1af509dd8be35a6732bc5c6fe27d41f3 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -3487,7 +3487,19 @@ var CanvasGraphics = (function() {
       if (fontDict.has('Encoding')) {
         var encoding = xref.fetchIfRef(fontDict.get('Encoding'));
         if (IsDict(encoding)) {
-          // Build a map between codes and glyphs
+          // Build a map of between codes and glyphs
+          // Load the base encoding
+          var baseName = encoding.get('BaseEncoding');
+          if (baseName) {
+            var base = Encodings[baseName.name];
+            var index = 0;
+            for (var j = 0, end = base.length; j < end; j++)
+              encodingMap[index++] = GlyphsUnicode[base[j]];
+          } else {
+            TODO('need to load default encoding');
+          }
+
+          // Load the differences between the base and original
           var differences = encoding.get('Differences');
           var index = 0;
           for (var j = 0; j < differences.length; j++) {