opentype.js icon indicating copy to clipboard operation
opentype.js copied to clipboard

substFormat: 1 is not yet supported for Calibri Font

Open xornor-web opened this issue 5 years ago • 1 comments
trafficstars

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 () at Bidi.latinLigature (..\node_modules\opentype.js\dist\opentype.js:12718:28) at C:\Users\Xornor\nodeJSpro\pptx2html\node_modules\opentype.js\dist\opentype.js:12911:24 at Array.forEach () at Bidi.applyLatinLigatures (..\node_modules\opentype.js\dist\opentype.js:12910:13) at Bidi.applyFeaturesToContexts (..\node_modules\opentype.js\dist\opentype.js:12932:30) at Bidi.processText (..\node_modules\opentype.js\dist\opentype.js:12947:15)

Steps to Reproduce (for bugs)

  1. 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);

xornor-web avatar Dec 09 '19 09:12 xornor-web

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.

Connum avatar Oct 22 '20 00:10 Connum