From ef04c1a6a1b4be8262537c4b871ff2082736ce74 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sun, 9 Nov 2025 07:58:09 -0800 Subject: [PATCH] Delete validate-font.js --- scripts/validate-font.js | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 scripts/validate-font.js diff --git a/scripts/validate-font.js b/scripts/validate-font.js deleted file mode 100644 index ba66d21..0000000 --- a/scripts/validate-font.js +++ /dev/null @@ -1,38 +0,0 @@ -import fs from "fs"; -import path from "path"; -import { fileURLToPath } from "url"; -import opentype from "opentype.js"; -import { SUPPORTED_CHARS } from "../src/glyphs.js"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); -const fontPath = path.join(__dirname, "..", "dist", "Stain-Regular.ttf"); - -if (!fs.existsSync(fontPath)) { - console.error("Font not found:", fontPath); - process.exit(1); -} - -try { - const font = opentype.loadSync(fontPath); - if (!font.glyphs || font.glyphs.length === 0) { - console.error("Font has no glyphs"); - process.exit(1); - } - const sample = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - for (const ch of sample) { - if (!SUPPORTED_CHARS.includes(ch)) { - console.error("Missing from SUPPORTED_CHARS:", ch); - process.exit(1); - } - const g = font.charToGlyph(ch); - if (!g || !g.path || g.path.commands.length === 0) { - console.error("Missing or empty glyph for", ch); - process.exit(1); - } - } - console.log("Font validation passed."); -} catch (e) { - console.error("Error validating font:", e); - process.exit(1); -}