From 396dbe51351c481c7176fe94195eb49ab5caf79d Mon Sep 17 00:00:00 2001 From: sbarman Date: Fri, 8 Jul 2011 15:28:04 -0700 Subject: [PATCH] fix encoding table --- pdf.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pdf.js b/pdf.js index eef6deed5..c14213eb1 100644 --- 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++) {