From: notmasteryet Date: Mon, 19 Sep 2011 03:44:25 +0000 (-0500) Subject: Fix for 16-bit 'loca' table X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=ebb9d7dd2c18bc059fb6331e236581da42b3c785;p=pdf.js.git Fix for 16-bit 'loca' table --- diff --git a/fonts.js b/fonts.js index b175490..b1c164d 100644 --- a/fonts.js +++ b/fonts.js @@ -1071,11 +1071,11 @@ var Font = (function Font() { } else { itemSize = 2; itemDecode = function(data, offset) { - return (data[offset] << 8) | data[offset + 1]; + return (data[offset] << 9) | (data[offset + 1] << 1); }; itemEncode = function(data, offset, value) { - data[offset] = (value >> 8) & 0xFF; - data[offset + 1] = value & 0xFF; + data[offset] = (value >> 9) & 0xFF; + data[offset + 1] = (value >> 1) & 0xFF; }; } var locaData = loca.data;