From e64e7dc7b33d841f96151db285dac212b80ddf16 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sat, 8 Nov 2025 23:01:29 -0800 Subject: [PATCH] Refactor: Use full charset (upper, lower, digits, punct) --- scripts/build-font.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/scripts/build-font.js b/scripts/build-font.js index 32172e6..d1477cc 100644 --- a/scripts/build-font.js +++ b/scripts/build-font.js @@ -2,7 +2,7 @@ import fs from "fs"; import path from "path"; import { fileURLToPath } from "url"; import opentype from "opentype.js"; -import { buildGlyph, METRICS } from "../src/glyphs.js"; +import { buildGlyph, METRICS, SUPPORTED_CHARS } from "../src/glyphs.js"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); @@ -12,14 +12,6 @@ if (!fs.existsSync(distDir)) fs.mkdirSync(distDir, { recursive: true }); const FAMILY = "Stain"; const STYLE = "Regular"; -const charset = [ - " ", - "A","B","C","D","E","F","G","H","I","J","K","L","M", - "N","O","P","Q","R","S","T","U","V","W","X","Y","Z", - "0","1","2","3","4","5","6","7","8","9", - ".",",",":",";","!","?","-","–","—","@" -]; - function buildNotdef() { const w = 600; const p = new opentype.Path(); @@ -55,7 +47,7 @@ function createGlyph(ch) { function buildFont() { const glyphs = [buildNotdef()]; - charset.forEach(ch => glyphs.push(createGlyph(ch))); + SUPPORTED_CHARS.forEach(ch => glyphs.push(createGlyph(ch))); const font = new opentype.Font({ familyName: FAMILY,