To feed the fonts to the AI, he created grids of characters — each character fitting in a 64x64 pixel box — so they could then be directly compared with one another. In the process he got the neural net to create what he calls a “font vector” — a kind of abstract mathematical construct that singularly defines the font. You can read about the details of how he did that in a blog post here.

More interesting is what can be done with the resulting vector, as Bernhardsson explains:

Since every font is a vector, we can create arbitrary font vectors and generate output from it. We can... pick a font vector and generate new fonts from random perturbations... We can also generate completely new fonts. If we model the distribution of font vectors as a multivariate normal, we can sample random vectors from it and look at the fonts they generate.

In fact, that’s what you can see in the GIF above. It’s pretty smart, too: it’s learned, for instance, that many fonts use upper case characters for the lower case set, and it intelligently switches between the two depending on the type of font it’s creating.