import { type RequestHandler } from "@sveltejs/kit"; import { ImageResponse, type ImageResponseOptions } from "$lib/index.js"; import { CustomFont, GoogleFont, resolveFonts } from "$lib/fonts.js"; import RegularFont from "./(components)/SpaceMono-Regular.ttf?url"; import { read } from "$app/server"; const spaceMonoBold = new GoogleFont("Space Mono", { weight: 700, }); const customRegular = new CustomFont("Space Mono", () => read(RegularFont).arrayBuffer(), { weight: 400, }); export const GET: RequestHandler = async ({ url }) => { const format = url.searchParams.get("format") as ImageResponseOptions['format'] || "png"; const html = `