From a7c3ebcac372c87e082c77e634640502a9bfd600 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Wed, 29 Jun 2011 21:30:25 +0200 Subject: [PATCH] Do not include the padding size in the length declared in the table header --- fonts.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fonts.js b/fonts.js index e4dfd3541..191652c1d 100644 --- a/fonts.js +++ b/fonts.js @@ -236,6 +236,9 @@ var Font = (function () { // offset var offset = offsets.virtualOffset; + // length + var length = data.length; + // Per spec tables must be 4-bytes align so add padding as needed while (data.length & 3) data.push(0x00); @@ -243,9 +246,6 @@ var Font = (function () { while (offsets.virtualOffset & 3) offsets.virtualOffset++; - // length - var length = data.length; - // checksum var checksum = 0; for (var i = 0; i < length; i+=4)