From: notmasteryet Date: Sun, 18 Sep 2011 17:08:52 +0000 (-0500) Subject: Fixing the CID to GID mapping for cid fonts (regression of arial_unicode_XX_cidfont... X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=1c5b1cbc3449c6f10a37d888c7f2de29779680ee;p=pdf.js.git Fixing the CID to GID mapping for cid fonts (regression of arial_unicode_XX_cidfont.pdf) --- diff --git a/fonts.js b/fonts.js index 8740485..6c70f36 100644 --- 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 = [];