How a Handwriting Font Is Made

After reading this you will understand what happens between the photo of your handwriting and the TrueType file you download: how letters are found, scaled, spaced and rotated so your typing looks hand-written rather than stamped.

What the tool does and one example

You print a template, write each letter in its box, photograph the page, and the tool builds a font file from the ink. The result is a normal .ttf that any program can use. Type the word letter and the doubled t is drawn two different ways, because the font quietly swaps between two or three versions of each lowercase letter as you type.

That swapping is the single feature that separates a convincing handwriting font from an obvious one. A real hand never draws the same o twice. A font with one glyph per letter draws the same o every time, and the eye notices the repetition within a few words. The tool fights that repetition with alternates and with spacing that comes from the shapes you actually drew.

When to use it, and when not

Use it when you want your own hand available as a typeface: signing generated letters, captioning a comic, labelling a family recipe book, or giving a personal note the look of ink without scanning each note. The font covers the Latin letters, digits and common punctuation; with the extra-symbols template it also gains well over a hundred accented letters, enough for most Western and Central European languages.

Do not reach for it when you need pixel-exact reproduction of one specific signature or a single drawing. A font generalises: it builds every word from the 81 to 162 boxes you filled in, so a word you never wrote still appears in your hand. If you only ever need one fixed image, photograph that image instead. For turning a drawing into blocky art, the ASCII art tool or the dithering tool fit better.

Write with a black felt-tip or gel pen. A 0.5 mm gel pen lays down a line roughly 0.5 mm wide, which survives photographing and thresholding. A ballpoint often draws a line under 0.2 mm wide and pale grey, and thin grey strokes break apart when the tool separates ink from paper.

From photo to outline: the pipeline

The work happens in a fixed order. Each step feeds the next.

  1. Locate the page. The four black corner squares give a perspective map from the photo back to the flat sheet, which undoes rotation, tilt and the keystone shape of a photo taken at an angle. The 16-bit code strip of small squares next to the top-left corner says which page of which template this is, and trying it in all four orientations tells the tool which way up the sheet lies.
  2. Correct the geometry. The printed box edges and baselines are straight on flat paper; on a photo of curled paper they bow. The tool finds a few hundred of them, fits a smooth correction to where they really are and samples every box through it, so a page that bulges by several millimetres still lines up with its grid.
  3. Separate ink from paper. Each box is compared with the paper around its strokes, so shadows and uneven light cancel out, and the ink becomes a smooth darkness map from 0 to 1. The printed guides, labels and pale letters are light blue, which the tool reads almost like white paper, so they drop out.
  4. Trace outlines. The outline is traced where the darkness map crosses one half, simplified, and turned into the quadratic curves a TrueType glyph is made of. Specks too small to be ink are dropped.
  5. Place on the em square. Each glyph is scaled and shifted so letters share a baseline and a consistent height.

The math of sizing and spacing a glyph

TrueType measures everything in font units on an em square, and this tool uses an em of 1000 units. Every box is first measured on the template's own scale, where the 8 mm cap-height guide equals 700 units (87.5 units per millimetre), so the resolution of your photo drops out of the sums. One factor then makes the median height of your flat-topped capitals (E, F, H, I, K, L, M, N, T, X and Z) exactly 700 units:

s = \frac{700}{h_{\mathrm{cap}}}

Here s is the scale factor and h_{\mathrm{cap}} is that median capital height in template units. If your capitals average 7.4 mm, then h_{\mathrm{cap}} = 7.4 \times 87.5 = 647.5 and s = 700 / 647.5 \approx 1.08. Every glyph is multiplied by the same s, so your own proportions survive: a b written 8.5 mm tall (744 template units) becomes about 804 units and still rises above the capitals if that is how you write. Without enough capitals the tool sizes from the x-height instead.

Side bearings (the blank space left and right of a letter) come from the shape, not from a fixed margin. For each side the tool looks at the band between the baseline and the x-height (the cap height for capitals) and measures how far the white reaches in from the letter's outermost point, capped at 15% of the band height. The curved side of an o leaves a deep white wedge above and below its widest point; the straight stem of an l leaves none. With w that average white depth and t the spacing target (11% of the x-height at the default setting), each side gets

b = t - 0.7\,w

so round letters sit closer to their neighbours than straight ones, which is what the eye expects.

Worked example: spacing an o and an l

The Try a sample sheet button fills the template in a handwriting-style system font, fakes a phone photo of it and runs the whole pipeline, so you can watch every step without picking up a pen. The numbers below follow one hand through sizing and spacing.

Scaling and spacing the letters o and l

  1. The capitals average 7.4 mm, so s = 700 / 647.5 \approx 1.08.
  2. The x is 4.4 mm tall: 4.4 \times 87.5 \times 1.08 \approx 416 units, the x-height. The spacing target is t = 0.11 \times 416 \approx 46 units.
  3. The straight l has no white wedge, w = 0, so each side gets 46 units. With a 50-unit stem its advance width (how far the cursor moves after it) is 46 + 50 + 46 = 142 units.
  4. The o is a circle 416 units across. Averaged over the band, with the depth capped at 0.15 \times 416 \approx 62 units, the white wedge on each side is about w = 32 units deep, so each side gets 46 - 0.7 \times 32 \approx 24 units and the advance is 24 + 416 + 24 = 464 units.

The o keeps barely half the side space of the l, yet in lol the gaps look equal, because the white inside the curves counts towards the space the eye sees between letters.

Interpreting the result

The clearest signal of quality is the variety in repeated letters. The font picks each letter's version from the letter before it: after a first version comes a second, after a second comes a third if you wrote one, and then the cycle starts again. Type eeeeee in a font with three versions per letter and the versions run 1, 2, 3, 1, 2, 3.

With three versions per letter the OpenType calt feature cycles through them, so no two neighbouring e glyphs are identical.

The second signal is spacing. Set a line of mixed round and straight letters and look for even colour, meaning no rivers of white and no collisions. Kerning pairs such as To, Ta, AV and r. are measured from the outlines: the o tucks under the T bar by roughly a tenth of the em, so the pair looks spaced like the rest rather than falling apart, and pairs whose shapes would touch, such as a long f hook over an l, are pushed apart instead.

With one version per letter, every double letter in "bookkeeper" is a stamped copy. With two versions the doubled o, k and e always differ, because each letter's version follows the one before it; a letter that returns later in the word can still repeat a drawing.

Common mistakes

Most poor results trace back to the photo, not the handwriting.

  • Pale ink. A grey ballpoint line can drop below the black threshold in patches, leaving a letter with a broken stroke. Use black felt-tip or gel pen.
  • Ink across the box edge. A stroke that runs more than about 2 mm past its box is cut off, and one that wanders mostly into the next box is counted as part of that box. Keep each letter inside its own box.
  • Glare and deep shadow. The corner squares and box edges correct the geometry of an angled shot, and gentle shadows cancel out, but glare that bleaches strokes or a shadow dark enough to swallow the ink cannot be undone. Shoot from above in daylight from a window, or use a flatbed scanner.
  • Contextual alternates switched off. The variety is real only if the application honours the calt feature. Browsers, LibreOffice and Adobe apps do it by default. In Word you must tick Use Contextual Alternates under Font, Advanced, or every repeat collapses to one glyph.

Write each accent once in its own box. The tool positions that single accent over every base letter that needs it, producing é, ñ, ü, ç, š and more than a hundred others. If you leave an accent box empty, the letters that need that accent are simply missing from the font, and apps show them in a fallback font.

Related tools

If you reached this page while working with codes rather than letters, the QR code generator and reader and the barcode generator handle machine-readable marks, which is also what the template's own corner squares and code strip are. For laying out many small images at once, such as a glyph preview sheet, the sprite sheet generator and splitter packs or slices a grid. Need filler art while you design a page around your new font? The placeholder image generator makes labelled blocks at any size.

Frequently asked questions

Is my handwriting uploaded anywhere?

No. The whole pipeline, from reading the photo to writing the TrueType file, runs in your browser. The image never leaves your device.

Why do the same letters look different as I type?

The font stores two or three drawings of each lowercase letter, and the OpenType calt feature picks each letter's drawing from the one before it. In letter the two t glyphs sit side by side, so they always get different drawings and the double letter never looks stamped.

What size pen should I use?

A 0.4 to 0.7 mm black gel or felt-tip pen. That gives a solid line about 0.5 mm wide, which stays solid when the tool separates ink from paper. The printed light-blue guides are ignored, so you can write right over them.

Can I get a scanner-quality result from a phone?

Yes, if you shoot straight down in even daylight. The corner squares correct small tilts and the box edges correct mild paper curl. A flatbed scanner still gives the cleanest edges because it removes angle and shadow entirely.

Which languages does the font cover?

Latin letters, digits and common punctuation, and with the extra-symbols template well over a hundred accented letters built from the accents you write once. That covers most Western and Central European languages, including French, Spanish, German, Czech and Portuguese. Polish still needs ą, ę and ł, which the template does not have.