Most "signature generator" sites either slap a cursive font on your name, or upload your image to a server. I wanted neither: real pen strokes, and nothing ever leaving the browser. Here is how I built one that runs entirely client-side.
Fonts don't look like signatures
A font repeats the same glyph every time — a dead giveaway. Real signatures are one or two continuous strokes with variable-width ink, connected letters, and a flourished initial and tail. So instead of a font I used a small recurrent neural network (Alex Graves' handwriting-synthesis model) that outputs pen offsets (dx, dy, pen-up) step by step.
const offsets = model.write(name, { bias, style, seed }); const line = offsetsToLine(offsets); // -> strokes of [x, y] points bias controls neatness, style picks one of ~80 handwriting styles, and seed makes a result reproducible. About 2.6 MB of weights load once into the browser.
Making it read as a signature, not handwriting
Raw model output looks like neat handwriting, not a signature. Three passes fix that:
- Connect the separate letters into one stroke with curved Bézier ligatures that follow the pen's exit/entry tangents.
- Flourish the first letter (a lead-in swash) and the last (a trailing tail) from a small library of parametric swash shapes.
- Vary each sample (slant, width, baseline wave) so a gallery of styles actually diverges instead of looking identical.
Everything renders to vector SVG, so export is a transparent-background SVG or PNG — no server round-trip.
Why client-side is the real win
- Privacy — your name and signature never touch a server.
- Cost — the site is static assets on Cloudflare, so N users cost $0 extra: the ~0.35s of inference per signature runs on their device.
- No limits — no rate limiting needed when you are not paying per request.
Gotchas
- The model is Latin-only, so I strip diacritics (
Nguyễn → Nguyen) before inference. -
model.writecan run long on weak phones, so I paint the gallery tile by tile — the first result shows in ~0.3s instead of waiting for all 10. - SVG can't vary stroke width along one path, so each stroke is split into constant-width runs bucketed by pen speed.
You can try the finished tool for free (no signup, no watermark): RoodyTools AI Signature Generator. There is also a draw-and-practice pad and a bunch of other free client-side tools.
Happy to answer anything about the stroke model or the client-side setup in the comments.
