From cd930d9248f323c1ec622098ed3b6420e23f4ca1 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Fri, 2 Sep 2011 15:47:34 +0200 Subject: [PATCH] Ensure the characters between 127 and 255 are shown --- pdf.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pdf.js b/pdf.js index 2feade07e..631496481 100644 --- a/pdf.js +++ b/pdf.js @@ -4301,9 +4301,12 @@ var PartialEvaluator = (function() { for (var i = firstChar; i <= lastChar; i++) { var glyph = diffEncoding[i] || baseEncoding[i]; if (glyph) { - glyphsMap[glyph] = encodingMap[i] = GlyphsUnicode[glyph] || i; - if (glyphsMap[glyph] <= 0x1f) - glyphsMap[glyph] = encodingMap[i] += 0xE000; + var index = GlyphsUnicode[glyph] || i; + glyphsMap[glyph] = encodingMap[i] = index; + + var kCmapGlyphOffset = 0xE000; + if (index <= 0x1f || (index >= 127 && index <= 255)) + glyphsMap[glyph] = encodingMap[i] += kCmapGlyphOffset; } }