// Renders the Open Graph / Twitter card (public/og.png, 1200 × 630): the app icon, the name, // and one line. scripts/og/hex-icon.png is the 1024 px icon exported from the built Hex.app // (iconutil -c iconset Hex.app/Contents/Resources/AppIcon.icns), so it carries Icon // Composer's glass and shadow. import { chromium } from "playwright" import { readFileSync } from "node:fs" import { fileURLToPath } from "node:url" const icon = readFileSync(new URL("./og/hex-icon.png", import.meta.url)).toString("base64") const font = readFileSync(new URL("../node_modules/@fontsource-variable/inter/files/inter-latin-wght-normal.woff2", import.meta.url)).toString("base64") const html = `

Hex

Local voice dictation for Mac, Windows, and Linux.

` const browser = await chromium.launch({ headless: true }) try { const page = await browser.newPage({ viewport: { width: 1200, height: 630 }, deviceScaleFactor: 1 }) await page.setContent(html) await page.evaluate(() => document.fonts.ready) await page.screenshot({ path: fileURLToPath(new URL("../public/og.png", import.meta.url)) }) } finally { await browser.close() }