From e32ecc44d38c2bcba70e6955beca37042a0c07b4 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Wed, 29 Aug 2012 12:58:12 -0500 Subject: [PATCH] Fixes CFF test and CFF int16 parsing --- src/fonts.js | 2 +- test/unit/font_spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fonts.js b/src/fonts.js index 0b6a58aba..1b20e771d 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -4500,7 +4500,7 @@ var CFFParser = (function CFFParserClosure() { return parseFloatOperand(pos); } else if (value === 28) { value = dict[pos++]; - value = (value << 8) | dict[pos++]; + value = ((value << 24) | (dict[pos++] << 16)) >> 16; return value; } else if (value === 29) { value = dict[pos++]; diff --git a/test/unit/font_spec.js b/test/unit/font_spec.js index 9f0969324..b2436778d 100644 --- a/test/unit/font_spec.js +++ b/test/unit/font_spec.js @@ -42,7 +42,7 @@ describe('font', function() { } describe('CFFParser', function() { - var parser = new CFFParser(fontData); + var parser = new CFFParser(fontData, {}); var cff = parser.parse(); it('parses header', function() {