Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example of keeping the specified layout-features #75

Open
yisibl opened this issue Mar 21, 2023 · 1 comment
Open

Add an example of keeping the specified layout-features #75

yisibl opened this issue Mar 21, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@yisibl
Copy link
Contributor

yisibl commented Mar 21, 2023

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

@khaledhosny khaledhosny added the help wanted Extra attention is needed label Apr 24, 2023
@KonghaYao
Copy link

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

harfbuzzjs/hbjs.js

Lines 14 to 21 in 28ae985

function hb_tag(s) {
return (
(s.charCodeAt(0) & 0xFF) << 24 |
(s.charCodeAt(1) & 0xFF) << 16 |
(s.charCodeAt(2) & 0xFF) << 8 |
(s.charCodeAt(3) & 0xFF) << 0
);
}

image

@khaledhosny khaledhosny changed the title Adds an example of keeping the specified layout-features Add an example of keeping the specified layout-features Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants