From 4236fbb5a930d85e95e5faa466f770efba675460 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sun, 9 Nov 2025 08:58:32 -0800 Subject: [PATCH] Fix: Use glyphs array instead of addGlyph --- scripts/build-font.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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`);