1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Refactors CMapFactory.create to make it async

This commit is contained in:
Manas 2016-02-28 21:50:29 +05:30
parent c6d2b7f9d9
commit f6d28ca323
8 changed files with 559 additions and 473 deletions

View file

@ -11,7 +11,8 @@ describe('font_post', function() {
loadedName: 'font',
type: 'TrueType',
differences: [],
defaultEncoding: []
defaultEncoding: [],
toUnicode: new ToUnicodeMap([])
});
ttx(font.data, function(result) { output = result; });
runs(function() {
@ -23,17 +24,20 @@ describe('font_post', function() {
it('has invalid selection attributes presence', function() {
var output;
waitsFor(function() { return output; }, 10000);
var font = new Font("font", new Stream(font1282), {
loadedName: 'font',
type: 'CIDFontType2',
differences: [],
defaultEncoding: [],
cMap: CMapFactory.create(new Name('Identity-H'))
});
ttx(font.data, function(result) { output = result; });
runs(function() {
verifyTtxOutput(output);
expect(/<OS_2>\s*<version value="3"\/>/.test(output)).toEqual(true);
CMapFactory.create(new Name('Identity-H')).then(function (cMap) {
var font = new Font("font", new Stream(font1282), {
loadedName: 'font',
type: 'CIDFontType2',
differences: [],
defaultEncoding: [],
cMap: cMap,
toUnicode: new ToUnicodeMap([])
});
ttx(font.data, function(result) { output = result; });
runs(function() {
verifyTtxOutput(output);
expect(/<OS_2>\s*<version value="3"\/>/.test(output)).toEqual(true);
});
});
});
});