Skip to content

Commit

Permalink
Don't limit to a concurrency of 1 now that harfbuzzjs auto-grows the …
Browse files Browse the repository at this point in the history
…wasm heap
  • Loading branch information
papandreou committed Jul 30, 2022
1 parent 4869511 commit e093995
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const loadAndInitializeHarfbuzz = _.once(async () => {
return [exports, heapu8];
});

async function subsetFont(
module.exports = async function subsetFont(
originalFont,
text,
{ targetFormat = fontverter.detectFormat(originalFont), preserveNameIds } = {}
Expand Down Expand Up @@ -113,7 +113,4 @@ async function subsetFont(
exports.free(fontBuffer);

return await fontverter.convert(subsetFont, targetFormat, 'truetype');
}

const limiter = require('p-limit')(1);
module.exports = (...args) => limiter(() => subsetFont(...args));
};
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"dependencies": {
"fontverter": "^2.0.0",
"harfbuzzjs": "^0.3.0",
"lodash": "^4.17.21",
"p-limit": "^3.1.0"
"lodash": "^4.17.21"
},
"devDependencies": {
"coveralls": "^3.0.2",
Expand Down

0 comments on commit e093995

Please sign in to comment.