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
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.
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:
uploads/ folder.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:
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.
Every sample needs a baseline, the line the letters sit on.
. ! ? :) give it: the bottom of
their ink.g j p q y , ; ( ) _ ' "…) take it from the
others on their line, or, in a single-glyph box, from boxes beside it on the page.The red lines on the page are drawn at their actual slope.
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 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 |
The Results tab shows every character as three panels, all at one common scale with the baseline and cell drawn in:
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.
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).
&.png,
uni0026.png, U+0026.png) is filled in for you.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.
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.
Making a new sample? Follow Preparing type samples: 1.5 or double line spacing, a space between characters, every character several times, a greyscale scan.
| 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 |