]> git.parisson.com Git - pdf.js.git/commitdiff
Fixing the CID to GID mapping for cid fonts (regression of arial_unicode_XX_cidfont...
authornotmasteryet <async.processingjs@yahoo.com>
Sun, 18 Sep 2011 17:08:52 +0000 (12:08 -0500)
committernotmasteryet <async.processingjs@yahoo.com>
Sun, 18 Sep 2011 17:08:52 +0000 (12:08 -0500)
fonts.js

index 874048532cf9c292c6f482f40a03d334c1b40a83..6c70f36be1020494c62f8e3ae978111ad2f77d1a 100644 (file)
--- a/fonts.js
+++ b/fonts.js
@@ -1165,10 +1165,13 @@ var Font = (function Font() {
             };
           }
         } else {
-          for (i = 0; i <= 0x1f; i++)
-            encoding[i].unicode += kCmapGlyphOffset;
-          for (i = 127; i <= 255; i++)
-            encoding[i].unicode += kCmapGlyphOffset;
+          for (i in encoding) {
+            if (encoding.hasOwnProperty(i)) {
+              var unicode = encoding[i].unicode;
+              if (unicode <= 0x1f || (unicode >= 127 && unicode <= 255))
+                encoding[i].unicode = unicode += kCmapGlyphOffset;
+            }
+          }
         }
 
         var glyphs = [];