diff --git a/scripts/build-font.js b/scripts/build-font.js index 14dde55..f631873 100644 --- a/scripts/build-font.js +++ b/scripts/build-font.js @@ -18,24 +18,24 @@ const ascender = 800; const descender = -200; const advanceWidth = 600; +const glyphs = [ + glyphA(opentype, advanceWidth), + glypha(opentype, advanceWidth), + glyphB(opentype, advanceWidth), + glyphb(opentype, advanceWidth), + glyphC(opentype, advanceWidth), + glyphc(opentype, advanceWidth) +]; + const font = new opentype.Font({ familyName, styleName: "Regular", unitsPerEm, ascender, descender, - glyphs: [] + glyphs }); -const addGlyph = (g) => font.addGlyph(g); - -addGlyph(glyphA(opentype, advanceWidth)); -addGlyph(glypha(opentype, advanceWidth)); -addGlyph(glyphB(opentype, advanceWidth)); -addGlyph(glyphb(opentype, advanceWidth)); -addGlyph(glyphC(opentype, advanceWidth)); -addGlyph(glyphc(opentype, advanceWidth)); - const otfBuffer = Buffer.from(font.toArrayBuffer()); const baseName = "Stain"; const otfPath = path.join(outDir, `${baseName}.otf`);