Docs
Quickstart
From nothing to a font file in a few lines. Pick the SDK or the API: both make the same font.
With the SDK
1. Get the package
Download it from your account. It's an npm package in a single file, with the engine inside:
npm install ./typomat-engine-0.1.0.tgz2. Compile a font
import { writeFile } from "node:fs/promises";
import { createEngine } from "@typomat/engine";
const engine = await createEngine({ licenseKey: process.env.TYPOMAT_LICENSE });
const ttf = engine.compile(
{ weight: 118, contrast: 0.92, serif: 0.5, xHeight: 470 },
{ name: "Acme Display" },
);
await writeFile("acme-display.ttf", ttf);3. Or use it in the browser
The same code runs there, and you can load the font straight into the page. Most bundlers pick up engine.wasm by themselves. If yours doesn't, serve the file and pass its address as wasm.
const face = new FontFace("Acme Display", ttf);
document.fonts.add(await face.load());
document.body.style.fontFamily = "Acme Display";With the API
Make a key in your account, and send it with a few parameters. The free trial gives you one straight away, with no card. The response is the font file:
curl https://engine.typomat.app/api/v1/fonts \
-H "Authorization: Bearer $TYPOMAT_KEY" \
-H "Content-Type: application/json" \
-o acme-display.ttf \
-d '{ "name": "Acme Display", "parameters": { "weight": 118, "contrast": 0.92, "serif": 0.5, "xHeight": 470 } }'Next
- Browse the parameters, or turn them in the live console, which writes the code for you.
- Build controls into your product, off the main thread.
- Understand your licence key.