From 344bc2897fc1aef3c384a136223ba2ecd0504ce4 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sun, 9 Nov 2025 12:08:48 -0800 Subject: [PATCH] Fix: ensure space/period glyphs added --- scripts/build-font.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/build-font.js b/scripts/build-font.js index 4cda4fe..f4001dc 100644 --- a/scripts/build-font.js +++ b/scripts/build-font.js @@ -41,7 +41,27 @@ const ascender = 800; const descender = -200; const defaultAdv = 600; +const mkGlyph = (name, unicode, adv, pathFn) => + new opentype.Glyph({ + name, + unicode, + advanceWidth: adv, + path: pathFn(new opentype.Path()) + }); + +const glyphSpace = mkGlyph("space", " ".codePointAt(0), 260, (p) => p); +const glyphPeriod = mkGlyph("period", ".".codePointAt(0), 260, (p) => { + p.moveTo(80, 0); + p.lineTo(80, 120); + p.lineTo(180, 120); + p.lineTo(180, 0); + p.close(); + return p; +}); + const glyphList = [ + glyphSpace, + glyphPeriod, glyphA(opentype, defaultAdv), glypha(opentype, defaultAdv), glyphB(opentype, defaultAdv),