Skip to content

Commit

Permalink
Revert "Don't limit to a concurrency of 1 now that harfbuzzjs auto-gr…
Browse files Browse the repository at this point in the history
…ows the wasm heap"

Whoops, this breaks the subfont test suite.

This reverts commit e093995.
  • Loading branch information
papandreou committed Jul 30, 2022
1 parent f6ba853 commit b546127
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 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];
});

module.exports = async function subsetFont(
async function subsetFont(
originalFont,
text,
{ targetFormat = fontverter.detectFormat(originalFont), preserveNameIds } = {}
Expand Down Expand Up @@ -113,4 +113,7 @@ module.exports = 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: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dependencies": {
"fontverter": "^2.0.0",
"harfbuzzjs": "^0.3.0",
"lodash": "^4.17.21"
"lodash": "^4.17.21",
"p-limit": "^3.1.0"
},
"devDependencies": {
"coveralls": "^3.0.2",
Expand Down

0 comments on commit b546127

Please sign in to comment.