From: Vivien Nicolas <21@vingtetun.org> Date: Mon, 5 Sep 2011 16:04:41 +0000 (+0200) Subject: Do not add kCmapGlyphOffset to Type1C mapping unless it is necessary X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=cea04080677f7f9cbc245d2db4ccba039ce5d535;p=pdf.js.git Do not add kCmapGlyphOffset to Type1C mapping unless it is necessary --- diff --git a/fonts.js b/fonts.js index 03b87a8..d199402 100755 --- a/fonts.js +++ b/fonts.js @@ -2252,9 +2252,12 @@ var Type2CFF = (function() { index = code = properties.glyphs[glyph] || index; var width = widths[code] || defaultWidth; - properties.encoding[index] = index + kCmapGlyphOffset; + if (index <= 0x1f || (index >= 127 && code <= 255)) + code += kCmapGlyphOffset; + + properties.encoding[index] = code; charstrings.push({ - unicode: code + kCmapGlyphOffset, + unicode: code, width: width, gid: i }); index++;