From 18661debdc1e01e1c386ece52e0dfce69fb5c476 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Fri, 2 Sep 2011 13:37:39 +0200 Subject: [PATCH] Use lenIV to read the subrs section --- fonts.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fonts.js b/fonts.js index f17fdfc56..5aa549e65 100755 --- a/fonts.js +++ b/fonts.js @@ -1457,7 +1457,7 @@ var Type1Parser = function() { for (var j = 0; j < argc; j++) charstring.push('drop'); - // If the flex mechanishm is not used in a font program, Adobe + // If the flex mechanism is not used in a font program, Adobe // state that that entries 0, 1 and 2 can simply be replace by // {}, which means that we can simply ignore them. if (index < 3) { @@ -1641,7 +1641,8 @@ var Type1Parser = function() { var length = parseInt(getToken()); getToken(); // read in 'RD' var data = eexec.slice(i + 1, i + 1 + length); - var encoded = decrypt(data, kCharStringsEncryptionKey, 4); + var lenIV = program.properties.private['lenIV']; + var encoded = decrypt(data, kCharStringsEncryptionKey, lenIV); var str = decodeCharString(encoded); i = i + 1 + length; getToken(); //read in 'NP'