Digitype

User guide

Digitype turns scans of typewriter type samples into clean, installable fonts. You show it where each character is on the scans; it averages every impression of each character, cleans it up and writes two fixed-pitch TrueType fonts.

See also: Preparing type samples · How it works · Settings reference

Install and start

You need Python 3.10 or newer.

Windows: run run.bat with your samples, from a terminal in the repository folder:

run.bat "D:\Scans\Type Samples"

The first run creates a .venv and installs the requirements; after that it starts at once.

Anywhere:

python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python3 -m digitype label "path/to/samples" [more files or folders] [--project DIR]

It opens http://127.0.0.1:8770 in your browser. Options: --port, --host (use 0.0.0.0 to reach it from another computer on your network), --no-browser.

Everything stays on your computer: the page talks only to the local server.

Projects, pages and font sets

A project is a folder (by default projects/<name of the first source>) that holds your labels, settings, a cache of the pages, and everything Regenerate writes. Projects are not part of git.

Pages. Every image file is a page, every frame of a multi-page TIFF is a page, and every page of a PDF is a page (rendered at 600 dpi). Add more at any time:

Big scans are fine: each page is converted to grey once and cached, so later visits are quick.

This page (under the page list) has per-page tools:

Font sets. One project can hold several typefaces, for example a sample book with a different face on every page. Each typeface is its own font set, chosen in the top bar:

Labelling

Draw a box around a character and type it, then press Enter.

Type a whole line. Draw one box around a run of text and type exactly what it says, spaces included. The box becomes one cell per character, and each cell’s character is drawn under it so you can check the fit at a glance. This is the fast way to label body text, which gives you many samples of every common letter.

Editing boxes.

The Glyphs panel lists every character labelled in the current set with its sample count; click one to visit its samples in turn.

Baselines

Every sample needs a baseline, the line the letters sit on.

The red lines on the page are drawn at their actual slope.

Warnings and checks

A box turns red and explains itself in the side panel when the text can’t match the ink:

During Regenerate, a sample that clearly disagrees with the other samples of its character (often a label mistake, such as an ä labelled a, or a letter one cell off) is left out of the average. It is listed in the log, on the glyph’s card (“1 odd left out”), and in the enlarged view with a button to jump to its box.

Regenerate

Regenerate builds the current font set. The log shows each character as it goes. For each character, every sample is cut out, scaled to a common size, lined up with the others, averaged, traced, and also reduced to a seed and grown back. Details: How it works.

Output goes to projects/<name>/out/<NN set name>/:

File What it is
<name>-Average.ttf The averaged samples, traced: the most faithful version
<name>-Seed.ttf Each glyph reduced to its skeleton (seed) and grown back
seeds/seed_XXXX.json The seed of each character: strokes, half-widths, nodes
result.json What the Results page shows

Results and test type

The Results tab shows every character as three panels, all at one common scale with the baseline and cell drawn in:

  1. averaged: the averaged scan,
  2. traced: its outline (the Average font),
  3. seed, regrown: the Seed font, with the seed’s strokes in orange (toggle seed strokes).

Each card shows the sample count and match, how closely the seed and the trace agree. Sort by character, most or fewest samples, or worst match first (a quick way to find what needs more samples or a label fix). Click a card to enlarge it.

Test type at the top sets any text you type in both fonts as soon as they’re written, with a size slider. Characters the font doesn’t have yet are listed underneath.

Glyph images (cleaned-up or drawn characters)

The Glyph images tab takes clean pictures of single characters: a glyph you cleaned up, or a character the samples don’t have at all, drawn by hand or made with an AI image tool. When you Regenerate, a picture is used instead of the scans for its character, in both fonts (the scans are kept, just not used; untick use to go back to them).

  1. Add glyph images… (PNG, JPG, BMP, TIFF, WebP; dark on light, or on transparent).
  2. Type which character each picture is. A file named after its character (&.png, uni0026.png, U+0026.png) is filled in for you.
  3. It is placed automatically: onto the character’s own average when it has samples, otherwise where DejaVu Sans Mono puts that character, scaled to this face’s cap height (Regenerate once first so the face’s size is known). Drag to move, wheel to scale (Shift = fine), arrow keys nudge (Shift ×10); Auto place starts over. Compare with draws another character of the font faintly behind every picture, for size and weight.

To clean up a glyph you already have: enlarge it in Results and Save picture for clean-up. It saves an enlarged averaged scan named uniXXXX.png; clean it up and add the result back, and it is labelled and fitted onto its scans by itself.

The fonts

Both fonts are true monospaced fonts: every glyph is one cell wide (600 units on a 1000-unit em), and they are flagged fixed-pitch (post.isFixedPitch and PANOSE bProportion = 9), so font menus list them as monospaced. They carry the full set of names Windows needs and install normally.

The family name is the font set’s Font name setting, or the set’s name.

Tips for good results

Controls

Action How
Zoom Mouse wheel (the full-resolution scan loads as you zoom in)
Pan Right-drag, middle-drag, or Space + drag
Fit the page F
New box Drag on empty page, type its text, Enter (Esc cancels)
Select Click a box
Edit text Double-click, or Enter
Resize Drag a handle of the selected box
Move Shift + drag the box
Set baseline Shift + drag the red line
Nudge Arrow keys (Shift: ×10)
Delete Delete or Backspace