From: notmasteryet Date: Sun, 9 Oct 2011 14:13:10 +0000 (-0500) Subject: Making Type 2 font sanitazable (#631) X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=1444a7e7947424b29df689599505b33f2b0e9382;p=pdf.js.git Making Type 2 font sanitazable (#631) --- diff --git a/fonts.js b/fonts.js index 2ab3a90..45fe9c9 100644 --- a/fonts.js +++ b/fonts.js @@ -2271,7 +2271,7 @@ CFF.prototype = { 'return': 11, 'sub': [12, 11], 'div': [12, 12], - 'pop': [1, 12, 18], + 'pop': [139, 12, 18], 'drop' : [12, 18], 'endchar': 14, 'rmoveto': 21, @@ -2287,9 +2287,11 @@ CFF.prototype = { var cmd = map[command]; assert(cmd, 'Unknow command: ' + command); - if (isArray(cmd)) + if (isArray(cmd)) { charstring.splice(i++, 1, cmd[0], cmd[1]); - else + if (cmd.length > 2) + charstring.splice(++i, 0, cmd[2]); + } else if (cmd !== null) charstring[i] = cmd; } else { // Type1 charstring use a division for number above 32000