Kalam2 is a full-stack handwriting generation application. It consists of a FastAPI backend for generating SVG handwriting using machine learning, and a Next.js frontend for user interaction and visualization.
- Generate realistic handwriting in multiple styles
- Download handwriting as SVG (including A4 page layout)
- Customizable style, color, and layout options
- API endpoints for integration
- Install uv
- Install dependencies and activate virtual environment:
uv sync source .venv/bin/activate - Start the backend server:
The API will be available at
python main.py
http://localhost:8000/api/v1.
POST /api/v1/handwriting/generate— Generate handwriting from text linesPOST /api/v1/handwriting/a4page— Generate handwriting formatted for A4 pagesGET /api/v1/handwriting/styles— List available handwriting stylesGET /api/v1/handwriting/styles/{style_id}— Get details and preview for a style
- Install Node.js.
- Install dependencies:
pnpm install # or npm install - Start the development server:
The app will be available at
pnpm dev # or npm run devhttp://localhost:3000.
- Enter text and select a handwriting style to generate handwriting.
- Use the A4 page generator for multi-page output.
- Download generated SVGs for use in documents or printing.
- The frontend can be deployed on Vercel or any static hosting supporting Next.js.
- The backend can be deployed on any server supporting Python and FastAPI.
MIT License
- Built with FastAPI, Next.js, and TensorFlow.
- Handwriting model and styles are from https://github.com/sjvasquez/handwriting-synthesis.

