Replace the sample data with synthetic fixtures and regenerate goldens and thumbnails
The template harness, tests and thumbnails now use a neutral vendor, bank account and a generated sample wordmark (scripts/logo/make-sample-logo.mjs). Layout goldens and the 14 picker thumbnails are regenerated. Fixture strings keep their original lengths where layout tests depend on them.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// Renders the synthetic wordmark used as the sample logo in tests, thumbnails and scripts
|
||||
// (src/pdf/testing/fixtures/sample-wordmark-logo.png). Run: node scripts/logo/make-sample-logo.mjs
|
||||
import { writeFileSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { GlobalFonts, createCanvas } from "@napi-rs/canvas";
|
||||
|
||||
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const W = 2172;
|
||||
const H = 724;
|
||||
const size = Number(process.argv[2] ?? 300);
|
||||
GlobalFonts.registerFromPath(path.join(ROOT, process.argv[3] ?? "public/fonts/montserrat/Montserrat-ExtraBold.ttf"), "SampleMark");
|
||||
const canvas = createCanvas(W, H);
|
||||
const ctx = canvas.getContext("2d");
|
||||
ctx.fillStyle = "#1f3a6e";
|
||||
ctx.font = `${size}px SampleMark`;
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillText(process.argv[4] ?? "STUDIO", W / 2, H / 2);
|
||||
writeFileSync(path.join(ROOT, "src/pdf/testing/fixtures/sample-wordmark-logo.png"), canvas.toBuffer("image/png"));
|
||||
Reference in New Issue
Block a user