Skip to content

Commit

Permalink
Fix one more leak issue in the subset demo
Browse files Browse the repository at this point in the history
No need to create an input set, just add it to the one
input object has.

Related to #36
  • Loading branch information
ebraminio committed Apr 14, 2021
1 parent b3d66ef commit d8d54ad
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions subset/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ const writeFileAsync = require('util').promisify(fs.writeFile);
exports.hb_blob_destroy(blob);

/* Add your glyph indices here and subset */
const glyphs = exports.hb_set_create();

exports.hb_set_add(glyphs, 'a'.charCodeAt(0));
exports.hb_set_add(glyphs, 'b'.charCodeAt(0));
exports.hb_set_add(glyphs, 'c'.charCodeAt(0));

const input = exports.hb_subset_input_create_or_fail();
const input_glyphs = exports.hb_subset_input_unicode_set(input);
exports.hb_set_union(input_glyphs, glyphs);
const unicode_set = exports.hb_subset_input_unicode_set(input);
exports.hb_set_add(unicode_set, 'a'.charCodeAt(0));
exports.hb_set_add(unicode_set, 'b'.charCodeAt(0));
exports.hb_set_add(unicode_set, 'c'.charCodeAt(0));

// exports.hb_subset_input_set_drop_hints(input, true);
const subset = exports.hb_subset(face, input);

Expand Down

0 comments on commit d8d54ad

Please sign in to comment.