-
Notifications
You must be signed in to change notification settings - Fork 6
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
Upgrade harfbuzzjs 0.2.0 / harfbuzz 3.0.0 #12
Comments
Thanks for the heads up! I don't know what the equivalent of diff --git a/package.json b/package.json
index 5f2e712..94c684c 100644
--- a/package.json
+++ b/package.json
@@ -5,7 +5,7 @@
"main": "index.js",
"dependencies": {
"fontverter": "^2.0.0",
- "harfbuzzjs": "^0.1.5",
+ "harfbuzzjs": "^0.2.0",
"lodash": "^4.17.21",
"p-limit": "^3.1.0"
},
diff --git a/index.js b/index.js
index 904d287..ad85c42 100644
--- a/index.js
+++ b/index.js
@@ -45,10 +45,10 @@ async function subsetFont(
const input = exports.hb_subset_input_create_or_fail();
if (preserveNameIds) {
- const inputNameIds = exports.hb_subset_input_nameid_set(input);
- for (const nameId of preserveNameIds) {
- exports.hb_set_add(inputNameIds, nameId);
- }
+ // const inputNameIds = exports.hb_subset_input_nameid_set(input);
+ // for (const nameId of preserveNameIds) {
+ // exports.hb_set_add(inputNameIds, nameId);
+ // }
}
// Add unicodes indices
@@ -57,7 +57,7 @@ async function subsetFont(
exports.hb_set_add(inputUnicodes, c.codePointAt(0));
}
- const subset = exports.hb_subset(face, input);
+ const subset = exports.hb_subset_or_fail(face, input);
// Clean up
exports.hb_subset_input_destroy(input); When I link it into the subfont test suite, everything seems to work, except that one of the reference image-based tests complains that the web page renders differently before vs. after subsetting. It produces this image diff: I guess I'll just wait for the updated example 😇 |
It should be
Guess you had good progress here actually! |
Ah yeah, that works, now the (minimal) test suite here passes. I opened a PR here: #13 Would be nice to figure out why that subfont test fails, but I don't really know where to start 🙈 |
HarfBuzz 3.0.0 provides a different set of API for its subset functionality, opened this file to let you know about the release and the fact the upgrade needs some intervention. Thanks!
The text was updated successfully, but these errors were encountered: