]> git.parisson.com Git - pdf.js.git/commitdiff
Do not add kCmapGlyphOffset to Type1C mapping unless it is necessary
authorVivien Nicolas <21@vingtetun.org>
Mon, 5 Sep 2011 16:04:41 +0000 (18:04 +0200)
committerVivien Nicolas <21@vingtetun.org>
Mon, 5 Sep 2011 16:04:41 +0000 (18:04 +0200)
fonts.js

index 03b87a84f71cef9da038ac79aab31af687006548..d199402982bf3b970e27208a7dc0abd8e3051c76 100755 (executable)
--- 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++;