Handwriting to Font
Operator: Abdulla Al Fahad. How tools are built and checked
A font made from your handwriting starts with a sheet of boxes: a guideline set in every box and four black squares in the corners, printed from here. Write each character, photograph or scan the page, and the picture is straightened, each glyph is cut out and its outline traced, and a font file you can install is built.
The template covers Basic Latin (94 characters) and the Latin-1 letters (62 more, À to ÿ without × and ÷), 156 in all, 48 to a page, so four pages. You can scan only some of them; whatever you did not write is simply absent from the font.
Key features
- A printable PDF template for A4 or US Letter with baselines, x-height and cap-height lines, corner squares and a code strip that identifies the page, paper size and template version
- A scan reader that finds the corner squares, flattens perspective, and works in any rotation, from a flatbed scan or a phone photo
- Ink thresholds that adapt to uneven light, with despeckling and a slider for pale pens
- Sub-pixel outlines traced with marching squares, simplified and smoothed into quadratic curves, with sharp corners kept
- Left and right gaps, space width and editable kerning pairs, and a live preview in the font you are making
- TTF with kerning, OTF without it, and WOFF2
The template, the scan reader and the font files
Every page prints a nine-cell code above the grid: a start bit, one bit for the paper size, two for the template version, three for the page number, a parity bit and an end bit. The reader decodes it after fitting the four squares, so pages can be uploaded in any order, rotated any way, and a sheet from an older template is refused with a message.
Scale comes from the template, not from the photo: a capital letter written between the cap line and the baseline is 700 units tall in a 1,000-unit em, and the x-height line sits at 404. The cell height sets the scale, so A4 and Letter sheets give the same proportions.
The TTF is written by this page's own small writer: glyf outlines with quadratic curves, cmap format 4, a format 0 kern table, name, OS/2 and post tables. The OTF is a CFF build of the same outlines through opentype.js, which cannot write kerning pairs. WOFF2 comes from the TTF through wawoff2.
How it works
The picture is shrunk to at most 3,200 px, thresholded against a local mean, and the connected dark blobs that look like filled squares are collected. The four that form a convex quadrilateral of similar size are the corners.
A homography takes the corner centres to their known positions, and the page is resampled at 8 pixels per millimetre. Each cell is cropped inside its border, ink is anything darker than your darkness limit and 82% of the local mean, and blobs smaller than the speck limit are dropped.
Each glyph's mask is blurred slightly and traced at the 0.5 level, which places outline points between pixels. The loops are simplified with Douglas-Peucker, and vertices that turn by less than your corner angle become curve controls with on-curve midpoints between them, so strokes stay round and corners stay sharp.
The ink's left edge is moved to your left gap, the baseline of the printed guideline becomes y = 0, and the advance is the ink width plus both gaps.
Common use cases
- A wedding invitation needs the bride's own handwriting for the names: write the basic characters on two pages, install the TTF, and set the names in a design app.
- A teacher builds a worksheet font from neat printing, scanning pages 1 and 2 only because lower-case Latin-1 accents are not needed.
- A shop owner wants handwritten price tags on a website: export the WOFF2, load it with a CSS @font-face rule, and keep the TTF for the print files.
How to use this tool
- Choose A4 or Letter and download the template PDF.
- Print at 100% without scaling and write each character with a dark pen on its baseline.
- Scan or photograph every page you filled in, with all four black squares and the strip above the grid visible.
- Drop the pictures on the page and check the glyph gallery; press a glyph to leave it out.
- Name the font, set gaps, space width and kerning, and look at the preview.
- Download TTF, OTF or WOFF2.
Example
A synthetic A4 page 1 of the template, drawn by code with a vertical bar in the I box and a ring in the O box, and rendered at an angle and in three rotations (illustrative, not a real photograph)
Default settings: ink limit 115, speck limit 0.3 mm², left and right gap 45, space 300Glyph measurements and font check
The page was read as A4, page 1 in all three orientations. The bar measured 1.75 × 16.50 mm against a drawn 1.6 × 16.45 mm; the ring measured 16.00 × 16.00 mm with 105.0 mm² of ink against 106.0 mm². The outlines spanned y = 0 to 700, the cap height, and the font re-parsed with the glyphs mapped to I and O.Tips for best results
- Write at the size of the guide lines, since each letter's size comes from where it sits between them.
- Use a pen that gives even dark lines; a felt-tip is easier than a ballpoint with skips.
- Set the gaps and the space width before you touch kerning. Even side gaps fix most spacing problems; the kerning list is for a few pairs such as AV or To that still look loose.
Edge cases to watch
Shadows across the page can break the corner squares, so use even light and keep a hand out of the picture. Letters that touch a box edge are cut at the border, since the outer 0.8 mm of each cell is ignored.
Everything inside a box is traced as that character. A stray mark, a smudge larger than the speck limit or a neighbour's stroke that crosses into the box becomes part of the glyph, so check the gallery and leave a glyph out if it looks wrong.
Pale pens and light pencil fall under the ink threshold. Raise the ink darkness limit slider or go over the strokes in a darker pen before scanning.
Common errors and how to fix them
- The four black corner squares were not found, or the code above the grid could not be read
- Make sure all four squares and the strip above the grid are in the picture, sharp, in even light and not covered; avoid very dark backgrounds that merge with the squares, and use a page from this template.
Best practices
- Scan at 200 to 300 dpi, or take a phone photo from directly above with the page filling the frame.
- Test the font in a design app and check that your word processor or design app shows the glyphs you expect before using it widely.
What this version leaves out
There are no ligatures, alternates or contextual forms, so every letter looks the same each time it appears. Unicode coverage stops at Latin-1; other scripts need their own template. Kerning is a short editable list of common pairs (AV, To, r and so on), not an automatic spacing model, and OpenType output carries none of it. Test the font in the apps you plan to use before relying on it; browsers and operating systems are strict about font files, and a file one program accepts another may refuse.
Frequently asked questions
Can I use the font commercially?
It is your handwriting, so the font is yours; the page puts no licence or watermark in it. Check the licence terms of any app you embed it in.
Why does the OTF not have kerning?
opentype.js, which writes the OTF here, cannot write the pair-adjustment tables kerning needs, while the TTF and WOFF2 come from this page's own writer, which includes a kern table.
How do I add more characters later?
Fill in the remaining template pages and drop them on the page together with the earlier ones; pages are matched by the printed code, and a page scanned again replaces the older scan of the same page.