# Handwriting to Font > Print a template, write your letters, upload the photo and get your handwriting as a TTF font. Leave the page fields empty to get a printable handwriting template (PDF) for a character set. Write one character per box, photograph or scan the page and upload it: the four corner squares are found, the page is straightened, every box is read and your strokes are traced into a TrueType font with spacing and basic kerning. The same engine runs in Lumina Type Lab → Glyph Lab on your device. Part of usefulweb.site (https://usefulweb.site/). Part of [Lumina](https://lumina.usefulweb.site/) (ownerApp: lumina). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://luminahandwritingfont.usefulweb.site/ (interactive tool at https://luminahandwritingfont.usefulweb.site/tool) - JSON API: POST https://luminahandwritingfont.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://luminahandwritingfont.usefulweb.site/api/v1/tool) - OpenAPI: https://luminahandwritingfont.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://luminahandwritingfont.usefulweb.site/mcp - tool `lumina_handwriting_font` ## Inputs - preset (select): Character set of the template - paper (select): Paper size - custom (text): Your own characters (only for “Your own characters”) - page1 (file): Filled-in page (photo or scan: PNG, JPEG or WebP, up to 20 MB; empty = get the template) - page2 (file): Second page (optional) - page3 (file): Third page (optional) - familyName (text): Font name - ink (number): Ink level (share of paper brightness; higher picks up lighter strokes) - outline (select): Outlines - sideBearing (integer): Space on each side of a letter (font units) - spaceWidth (integer): Width of the space character (font units) - kerning (number): Automatic kerning strength (0 = off, 1 = strong) - sample (text): Sample text for the preview - date (text): Creation date written into the font (optional, YYYY-MM-DD) ## Method - Template: four 8 mm corner squares, a 16-bit code strip (2 sync bits, character set, page number, 6 check bits) and a grid of 6 × 7 boxes (A4) or 6 × 6 (US Letter). Each box has a 30 mm writing area with light guides for the cap height (700 font units), x-height (480), baseline (0) and descender; 1 mm equals 40 font units at 1000 units per em. - Page detection: luminance, Otsu's threshold on a reduced copy, connected dark components; the corner squares are the solid, square components forming the largest convex quadrilateral. A four-point projective transform (DLT) maps sheet millimetres to image pixels and is tried for both paper sizes and all four rotations until the code strip checks out, so sideways or upside-down photos work. - Each box is resampled through the transform (perspective correction, bilinear) at 3 to 9 samples per millimetre. Ink is darker than the given share of the box's own paper level (90th percentile), so light guide lines, shadows and uneven light are ignored; specks under 0.5 mm² and thin remnants along the box edge are removed. - Ink is traced with Lumina's raster vectorizer (exact pixel boundaries with holes), smoothed (edge midpoints and a binomial filter), simplified with Ramer–Douglas–Peucker and written as quadratic B-spline contours; turns sharper than 65° stay corners. Glyphs keep their height on the printed baseline. - Spacing: the writing slant is estimated as the median shear that makes tall glyphs narrowest; side bearings are measured in de-slanted coordinates. Kerning compares the right ink profile of each glyph with the left profile of the next in 25-unit bands and closes gaps wider than two side bearings by the chosen strength (−300 to +200 units, |k| ≥ 15). - The font is written and read back by the same TrueType writer and checks as Lumina Font Foundry and the lumina-font-builder tool (outlines, character map, checksums, kerning). ## Limits - Photos need all four corner squares, even light and sharp focus. Joined (cursive) writing is not split into letters, and no ligatures or alternates are made: one box gives one glyph. The fonts have no hinting. JPEG and WebP pages are decoded on the server; the app reads them on your device.