Close

01 / 10

GlyphGAN

Self-initiated · architecture after Radford et al. · 2020–2026 · Concept and development

Interpolated glyph shapes: a looping animation of a single white letterform on black, softening and re-forming as it passes through shapes between one typeface and another
A walk through the latent space, one letter becoming another.

A GAN trained on typefaces. What it produces is not a letterform but a continuous space of them, walked through so that one design flows into the next.

A generator turns random vectors into images, and a discriminator tries to tell those from real glyphs. Trained against each other, the generator ends up with a space of letterforms that can be walked rather than sampled. The walk is the work: shapes between real typefaces that are not any of them.

Diagram of the network in three rows. First, the generator: a strip of 200 random numbers becomes a 4 by 4 grid of 256 channels, then 8 by 8, 16 by 16 and 32 by 32 feature maps, each shown as its real activations, and finally a 64 by 64 lower-case a. Second, the discriminator: a row of real a’s from installed fonts and a row of generated ones pass through augmentation and four convolution layers to a real-or-fake score, with the error flowing back into both networks. Third, after training: eleven generated a’s from a spherical walk between three points
The generator, the discriminator, and a walk once training is done.

The 2020 version was a collaboration with Aleksi Halttunen. I rewrote it in 2026.

The dataset

No usable set of one glyph across thousands of typefaces exists, so it has to be made, and how it is made decides what the model learns. It is one letter at a time: a single glyph gives a clean design space, while all twenty-six without conditioning average into mush.

A font collection is also far less varied than its file count. On the machine this was built on, 3,639 faces came from 654 families, seventy of them GT America. Capping the set at three faces per family, spread across the weight range, cuts it to 1,405 and removes the skew.

The dataset comes from a companion tool, fontscrape: a macOS command line tool that renders one glyph from every installed font to a greyscale PNG, with the family cap, variable font instances and a licence filter built in.

The fontscrape help text in a macOS Terminal window: usage, then a column of flags for glyphs, sizes, rendering mode, margins, output, per-family cap, variations, manifest and licence filter
fontscrape, the scraper that makes the dataset.
Tofu: a row of nine empty rectangles, white outlines on black, at increasing weights: the .notdef box a face renders for a character it has no glyph for
Tofu: the box a font draws for a character it does not have.

It renders by glyph ID rather than by character. A face with no glyph for the letter is skipped instead of drawing its .notdef box, known as tofu, which a few hundred times over teaches the model a rectangle.

The model

A GAN’s latent space is smooth and walkable, which a morph needs; diffusion models make better single images and worse interpolations. StyleGAN2-ADA suits small datasets better but is licensed for research only, so this uses DiffAugment, which is BSD-licensed and gives most of the same benefit. The discriminator uses spectral rather than batch normalisation, because batch statistics at a batch size of 32 are too noisy. Labels are softened and about three percent are flipped, so the discriminator cannot win early and starve the generator of a gradient.

A training grid: six rows of eight generated a’s on black, crisp and varied in weight and width, a few of them slumping into shapes that are no longer letters
Samples from partway through training.

Training budgets in steps, not epochs: with a few hundred glyphs an epoch is a handful of steps. And small wins. A crisp 64-pixel model interpolates better than a soft large one, and a model with more parameters than pixels to fit collapses to a fixed pattern.

The walk is spherical rather than linear. A straight line between two Gaussian latents passes through norms the model never saw in training, so a linear morph washes out exactly halfway.

A second glyph

The same code, trained in 2026 on 1,356 ampersands, three faces per family, for 20,000 steps. An ampersand varies far more between typefaces than a lower-case a, and the walk moves between roman, italic and script forms.

The ampersand plates side-on: a run of glass ampersands in a line, each a little different from the last, rose-tinted at one end and silver at the other
The ampersand walk as glass plates, side-on, rendered in 2026.