]> git.parisson.com Git - pdf.js.git/commitdiff
Switch length versus offset mistake in readTableEntry
authorVivien Nicolas <21@vingtetun.org>
Fri, 15 Jul 2011 14:02:32 +0000 (16:02 +0200)
committerVivien Nicolas <21@vingtetun.org>
Fri, 15 Jul 2011 14:02:32 +0000 (16:02 +0200)
fonts.js

index 4eb9406ed490e5af06648decbe02695f3d6d8849..eb3b25d50e798f6c83fa218f993e2a89e32a62cd 100755 (executable)
--- a/fonts.js
+++ b/fonts.js
@@ -784,8 +784,8 @@ var Font = (function Font() {
         return {
           tag: tag,
           checksum: checksum,
-          length: offset,
-          offset: length,
+          length: length,
+          offset: offset,
           data: data
         };
       };
@@ -801,7 +801,7 @@ var Font = (function Font() {
       };
 
       function replaceCMapTable(cmap, font, properties) {
-        var start = (font.start ? font.start : 0) + cmap.length;
+        var start = (font.start ? font.start : 0) + cmap.offset;
         font.pos = start;
 
         var version = int16(font.getBytes(2));
@@ -970,7 +970,7 @@ var Font = (function Font() {
           // PDF did not contain a GIDMap for the font so create an identity cmap
             
           // First get the number of glyphs from the maxp table
-          font.pos = (font.start ? font.start : 0) + maxp.length;
+          font.pos = (font.start ? font.start : 0) + maxp.offset;
           var version = int16(font.getBytes(4));
           var numGlyphs = int16(font.getBytes(2));