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

@ -8,17 +8,20 @@ describe('font_post', function() {
it('has invalid version number', function() {
var output;
waitsFor(function() { return output; }, 10000);
var font = new Font("font", new Stream(font2109), {
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(/<post>\s*<formatType value="3\.0"\/>/.test(output)).toEqual(true);
CMapFactory.create(new Name('Identity-H')).then(function (cMap) {
var font = new Font("font", new Stream(font2109), {
loadedName: 'font',
type: 'CIDFontType2',
differences: [],
defaultEncoding: [],
cMap: cMap,
toUnicode: new ToUnicodeMap([])
});
ttx(font.data, function(result) { output = result; });
runs(function() {
verifyTtxOutput(output);
expect(/<post>\s*<formatType value="3\.0"\/>/.test(output)).toEqual(true);
});
});
});
@ -29,7 +32,8 @@ describe('font_post', function() {
loadedName: 'font',
type: 'TrueType',
differences: [],
defaultEncoding: []
defaultEncoding: [],
toUnicode: new ToUnicodeMap([])
});
ttx(font.data, function(result) { output = result; });
runs(function() {
@ -45,7 +49,8 @@ describe('font_post', function() {
loadedName: 'font',
type: 'TrueType',
differences: [],
defaultEncoding: []
defaultEncoding: [],
toUnicode: new ToUnicodeMap([])
});
ttx(font.data, function(result) { output = result; });
runs(function() {