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
script— Mathematical Script (cursive)boldscript— Bold Cursive (best Instagram default)fraktur,boldfraktur,sansbold,circled, …- Effects:
strikethrough,underline,upside,mirror, etc.
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/.