Skip to content

Black Friday

Annual Pro is $90 for the first year, normally $120. Or start monthly at $6 for two months, then $12.

Ends Dec 4, 11:59 PM PT.

Create an account
← Public packages

@kentcdodds/pie-night

Pie night sign-ups: hosts start an event, guests add the pies they are bringing and watch the list fill in live. Installable, with optional push notifications.

FollowForkOpen app

Files

embed-fonts.mjs

11 lines · 750 B · JavaScript
// Embeds the subset share-image fonts (Latin only) as base64 in src/fonts.ts.
// Fonts: Fredoka 600/700 and Nunito 800 (SIL Open Font License), subset with
// pyftsubset to U+0020-007E, U+00A0-00FF and common punctuation.
// Usage: node scripts/embed-fonts.mjs
import { readFileSync, writeFileSync } from 'node:fs'
const f = (n) => readFileSync(new URL(`./fonts/${n}.sub.ttf`, import.meta.url)).toString('base64')
writeFileSync(
	new URL('../src/fonts.ts', import.meta.url),
	`// Generated by scripts/embed-fonts.mjs. Fredoka and Nunito, SIL Open Font License 1.1.\nexport const FREDOKA_600 = '${f('fredoka-600')}'\nexport const FREDOKA_700 = '${f('fredoka-700')}'\nexport const NUNITO_800 = '${f('nunito-800')}'\n`,
)
console.log('fonts embedded')