From e2d808a60f88c69b20ea9c8e8fba38d62922ed15 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Fri, 15 Jul 2011 16:02:32 +0200 Subject: [PATCH] Switch length versus offset mistake in readTableEntry --- fonts.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fonts.js b/fonts.js index 4eb9406ed..eb3b25d50 100755 --- 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));