From 8145c00215f9d0c8c5b81fcd069961bf32d6b98b Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Wed, 31 Aug 2011 02:18:13 +0200 Subject: [PATCH] Fix another regression on pdf.pdf#5 --- fonts.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fonts.js b/fonts.js index 5333f0411..0d3c63c82 100755 --- a/fonts.js +++ b/fonts.js @@ -422,7 +422,6 @@ var Font = (function Font() { // Wrap the CFF data inside an OTF font file data = this.convert(name, cff, properties); - writeToFile(data, "/tmp/" + name + ".otf"); break; case 'TrueType': @@ -2210,7 +2209,7 @@ var Type2CFF = (function() { var charstrings = []; var differences = properties.differences; - var index = 1; + var index = 0; var kCmapGlyphOffset = 0xE000; for (var i = 1; i < charsets.length; i++) { var glyph = charsets[i]; @@ -2222,6 +2221,9 @@ var Type2CFF = (function() { } var code = differences.indexOf(glyph); + if (code == -1) + code = properties.glyphs[glyph] || index; + var width = widths[code] || defaultWidth; properties.encoding[index] = index + kCmapGlyphOffset; charstrings.push({unicode: code + kCmapGlyphOffset, width: width, gid: i});