CursiveGen API

Client-side convert() concepts today. Planned hosted JSON API: /api/v1/convert.

Status: Spec only — REST endpoints are not live

Client-side convert()

CursiveGen’s Unicode engine maps each character through style tables (Script, Bold Script, Fraktur, effects, and more — 49 styles total). In the Astro app this is import { convert } from '../lib/fontEngine.js'.

import { convert } from '@cursivegen/font-engine'; // planned package name

const bio = convert('Hello Instagram', 'boldscript');
// → 𝓗𝓮𝓵𝓵𝓸 𝓘𝓷𝓼𝓽𝓪𝓰𝓻𝓪𝓶

navigator.clipboard.writeText(bio);

Common style IDs

Future REST: POST /api/v1/convert

Intended contract for a hosted JSON API (authentication, rate limits, and SLA TBD).

Request

{
  "text": "string (required, max 2000 chars planned)",
  "style": "boldscript | script | … (required)",
  "options": {
    "preserveWhitespace": true
  }
}

Success response (200)

{
  "ok": true,
  "text": "Hello Instagram",
  "style": "boldscript",
  "result": "𝓗𝓮𝓵𝓵𝓸 𝓘𝓷𝓼𝓽𝓪𝓰𝓻𝓪𝓶",
  "meta": { "engine": "fontEngine", "version": "1" }
}

Error response (4xx)

{
  "ok": false,
  "error": {
    "code": "UNKNOWN_STYLE",
    "message": "Style not found"
  }
}

fetch() example (future)

// FUTURE — not live yet
const res = await fetch('https://cursivegen.com/api/v1/convert', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
  body: JSON.stringify({
    text: 'Hello Instagram',
    style: 'boldscript',
  }),
});

const data = await res.json();
// { "ok": true, "text": "Hello Instagram", "style": "boldscript", "result": "𝓗𝓮𝓵𝓵𝓸…" }

curl example (future)

curl -X POST https://cursivegen.com/api/v1/convert \
  -H 'Content-Type: application/json' \
  -d '{"text":"CursiveGen","style":"script"}'

Embedding today

Until the npm package and REST API ship, integrate by linking users to the Unicode Font Generator or reusing the open character maps from the Unicode cheat sheet. Chrome extension scaffold lives in the repo under extension/.

Questions for partners: Contact · Press kit: Press

Rate limits and ethics (planned)

A public REST API would need abuse protection: per-IP rate limits, maximum string length, and disallowance of bulk harassment payloads (spam styled usernames). CursiveGen will not ship an API that enables impersonation of banks or government accounts via homoglyph names. Style IDs will remain the same as the open generator so integrators cannot claim proprietary encodings for public Unicode ranges.

Versioning

The planned /api/v1/ prefix leaves room for breaking changes in v2 without silently altering outputs. Client-side convert() today version-tracks through the site build; if you mirror maps, pin a git commit hash in your README so Bold Script output stays stable across deploys.

Testing without the hosted API

Import the same logic the site uses from src/lib/fontEngine.js in a Node script for golden-file tests. Compare output against rows in the cheat sheet. For handwriting images, there is no JSON API — render in the browser or automate headless export separately.

Chrome extension integration

The Chrome extension bundles style tables locally rather than calling a remote API. When REST launches, the extension may optionally hydrate maps from CDN with offline fallback; that behavior is not live yet.

Partner checklist

Before embedding CursiveGen conversion in a third-party app, confirm you display the same style count as the public generator, link users to the compatibility matrix when paste fails, and do not brand Mathematical Unicode as a proprietary font format. For press-ready facts, use the press kit rather than scraping marketing pages.

API FAQ

Is there a public REST API today?

Not yet. Conversion runs client-side via convert() in fontEngine. The JSON endpoints below are a published future specification so integrators can plan against a stable contract.

Can I embed convert() in my site now?

Yes conceptually: copy the mapping approach or call convert(text, style) from the same engine patterns documented here. A packaged npm module is planned; until then, use the browser tool or mirror the Bold Script map.