← Back to archive

Repo of the Day

riCk97306/handwriting-font-pdf

Published: Dec 2, 2026

Open repository ↗

Claude Code & Antigravity skill that turns handwriting sample photos into smooth TTF/OTF fonts and renders assignments/PDFs with realistic margins, math, boxed tables, and writing flow

Summary

riCk97306/handwriting-font-pdf is a Python-based skill for Claude Code and Google Antigravity that turns photos of handwritten character sheets into TTF/OTF fonts and uses them to render source PDFs as multi-page handwritten documents. It also models writing flow, ink color, baseline variation, margins, tables, formulas, and diagrams rather than simply applying a font to ordinary typeset text.

What it is useful for

Engineers can use the project to build a reusable font from samples covering digits, Latin letters, and optional Greek or mathematical symbols. The README demonstrates replacing one existing glyph, adding symbols such as α–ω and ∇, and generating verification images to catch missing glyphs.

It is also suited to converting an existing Assignment.pdf into a handwritten-looking PDF. A reference notebook photo can provide the baseline angle and ink tone, while the renderer adds per-page and per-line variation, hand-drawn margins, and boxed tables. Headings and questions can use black ink, with blue ink for answers, equations, matrices, and diagrams.

Multiple handwriting profiles can be kept in separate directories without modifying the original samples or outputs. Internally, the project uses OpenCV, NumPy, and SciPy for image analysis, fontTools for TTF/OTF compilation, and Pillow and PyMuPDF for rendering and PDF export.

The documented workflow expects the appropriate source material: character sheets for required glyphs, a flow reference for handwriting style, and a source PDF for document conversion. Output is documented as A4 at 220 DPI, with JPEG compression tuned to remain under 10 MB. Before publishing handwriting photos or derived font files, the README advises obtaining the writer’s permission.

How engineers can use it

With the repository checked out and Python 3.10 or newer installed, install the documented dependencies:

pip install -r requirements.txt

Register the skill in a Claude Code project:

mkdir -p .claude/skills
cp -r skills/handwriting-font-pdf .claude/skills/handwriting-font-pdf

The README also documents an Antigravity workspace installation and the universal installer:

npx skills add riCk97306/handwriting-font-pdf

Before generating a font, the standalone analyzer can inspect connected components and estimate writing slope and pen color:

python skills/handwriting-font-pdf/scripts/analyze_sheet.py letters.jpg --out-dir ./tmp_analysis --thresh 65 --min-area 12
python skills/handwriting-font-pdf/scripts/analyze_sheet.py flow_reference.jpg --flow

Then place the sample images and target PDF in the workspace and prompt the installed agent, for example: “Build MyHandwriting.ttf and MyHandwriting.otf from letters.jpg and symbols.jpg, keep strokes slim, preserve loops, and generate glyph verification previews.” A second request can convert Assignment.pdf using those fonts and flow_reference.jpg.

The README documents standalone quick checks for analyze_sheet.py; direct CLI options for the font compiler and PDF composer are not specified, so consult the README and SKILL.md before automating those scripts directly.