opentype.js
opentype.js copied to clipboard
substFormat: 1 is not yet supported for Calibri Font
Expected Behavior
SubSet Font not creating for Calibri Font
Current Behavior
Error: lookupType: 7 - substFormat: 1 is not yet supported
at FeatureQuery.getLookupMethod (..\node_modules\opentype.js\dist\opentype.js:12239:20)
at FeatureQuery.lookupFeature (..\node_modules\opentype.js\dist\opentype.js:12295:34)
at ..\node_modules\opentype.js\dist\opentype.js:12720:43
at Array.forEach (
Steps to Reproduce (for bugs)
- I am creating calibri.ttf suset font from Node but error occurring
let filePath = "calibri.ttf";
let desFilePath = "sub_calibri.ttf";
var font = opentype.loadSync(filePath);
var subsetFont = undefined;
var glyphs = font.stringToGlyphs("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
subsetFont = new opentype.Font({
familyName: font.names.fontFamily.en,
styleName: font.names.fontSubfamily.en,
unitsPerEm: font.unitsPerEm,
ascender: font.ascender,
descender: font.descender,
glyphs: glyphs
});
fs.writeFileSync(desFilePath, Buffer.from(subsetFont.toArrayBuffer()));
var fontEnable = opentype.loadSync(desFilePath);
I'm currently working on writing support for lookup type 6 (format 1 and 3 are done) and hope to find the time to implement all other missing lookup types as well.