]> git.parisson.com Git - pdf.js.git/commitdiff
Fix another regression on pdf.pdf#5
authorVivien Nicolas <21@vingtetun.org>
Wed, 31 Aug 2011 00:18:13 +0000 (02:18 +0200)
committerVivien Nicolas <21@vingtetun.org>
Wed, 31 Aug 2011 00:18:13 +0000 (02:18 +0200)
fonts.js

index 5333f04116e22cbec15b03057e45a08252cb2754..0d3c63c82ea751d844da04803ac9e3a61fe55ea7 100755 (executable)
--- 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});