]> git.parisson.com Git - pdf.js.git/commitdiff
Fix a small issue with the 'name' table
authorVivien Nicolas <21@vingtetun.org>
Mon, 4 Jul 2011 02:39:58 +0000 (04:39 +0200)
committerVivien Nicolas <21@vingtetun.org>
Mon, 4 Jul 2011 02:39:58 +0000 (04:39 +0200)
fonts.js

index 8bee706b2ad9782642e631783b13d40c549c444b..dceda2cdda0d9d8231585f731daba07ff280cc5b 100644 (file)
--- a/fonts.js
+++ b/fonts.js
@@ -988,7 +988,7 @@ var Font = (function Font() {
         var nameTable =
           "\x00\x00" +                           // format
           string16(namesRecordCount) +           // Number of names Record
-          string16(namesRecordCount * 12 + 6);   // Storage
+          string16(namesRecordCount * 12 + 6);   // Offset to start of storage
 
         // Build the name records field
         var strOffset = 0;
@@ -1000,7 +1000,7 @@ var Font = (function Font() {
               platforms[i] + // platform ID
               encodings[i] + // encoding ID
               languages[i] + // language ID
-              string16(i) + // name ID
+              string16(j) + // name ID
               string16(str.length) +
               string16(strOffset);
             nameTable += nameRecord;
@@ -1008,9 +1008,9 @@ var Font = (function Font() {
           }
         }
 
-                   nameTable += strings.join("") + stringsUnicode.join("");
+        nameTable += strings.join("") + stringsUnicode.join("");
         return nameTable;
-      }
+      };
 
            function isFixedPitch(glyphs) {
              for (var i = 0; i < glyphs.length - 1; i++) {