1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

CFF parser didn't count hints defined by hstem/vstem

This commit is contained in:
vyv03354 2013-01-26 22:08:45 +09:00
parent f7a0d6ccc4
commit a254de86fb
2 changed files with 31 additions and 9 deletions

View file

@ -96,6 +96,28 @@ describe('font', function() {
expect(topDict.getByName('Private')).toEqual([45, 102]);
});
it('parses a CharString having cntrmask', function() {
var bytes = new Uint8Array([0, 1, // count
1, // offsetSize
0, // offset[0]
38, // end
149, 149, 149, 149, 149, 149, 149, 149,
149, 149, 149, 149, 149, 149, 149, 149,
1, // hstem
149, 149, 149, 149, 149, 149, 149, 149,
149, 149, 149, 149, 149, 149, 149, 149,
3, // vstem
20, // cntrmask
22, 22, // fail if misparsed as hmoveto
14 // endchar
]);
parser.bytes = bytes;
var charStrings = parser.parseCharStrings(0);
expect(charStrings.count).toEqual(1);
// shoudn't be sanitized
expect(charStrings.get(0).length).toEqual(38);
});
it('parses predefined charsets', function() {
var charset = parser.parseCharsets(0, 0, null, true);
expect(charset.predefined).toEqual(true);