harfbuzzjs icon indicating copy to clipboard operation
harfbuzzjs copied to clipboard

Add an example of keeping the specified layout-features

Open yisibl opened this issue 2 years ago • 1 comments

--layout-features=list of string table tags or *

yisibl avatar Mar 21 '23 13:03 yisibl

I used the .wasm directly. Create the set which will contain user inputs , and put features which you want in the set. @yisibl

const ptr = exports.hb_subset_input_create_or_fail();
const layoutFeatures = exports.hb_subset_input_set(
      ptr,
      6 /** HB_SUBSET_SETS_LAYOUT_FEATURE_TAG **/
  );
exports.hb_set_add(layoutFeatures,hb_tag('smcp'));  // hb_tag function is in the source code of hb.js

https://github.com/harfbuzz/harfbuzzjs/blob/28ae985d871d436e2b0ef2be61157a05d7d19b5c/hbjs.js#L14-L21 image

KonghaYao avatar Oct 14 '23 13:10 KonghaYao