Can AI Teach Computers to Design Fonts? A Journey into Automated Typography
The article explores the author's experiments combining artificial intelligence with typography, detailing the development of algorithms that measure font attributes, compute similarity scores, and generate rule‑based design systems, while reflecting on the challenges, inspirations, and future possibilities of AI‑driven font selection and design.
Background
The author, fascinated by the mathematical purity of design since becoming a designer, cites influences such as Swiss design, Karl Gerstner’s Programmatic Design , and layout algorithms at Prismatic and Flipboard. In 2015 he joined The Grid, an AI‑powered website builder that designs layouts without templates, and set out to improve its typographic design system.
Definition
He clarifies that typography is the use of type, while type design is the creation of new typefaces. "AI typography" therefore means using computers to make design decisions about existing fonts rather than merely generating new fonts.
Part 1: Learning to See
Humans perceive fonts through emotion and visual cues, but computers only see .otf files and numeric color values. To bridge this gap the author defines measurable typographic attributes such as x‑height, stroke contrast, width, ascenders, and counters, and categorises fonts into styles like Grotesque, Humanist, Didone, Transitional, Fraktur, and Rotunda.
Manual labeling is time‑consuming and unscalable, so he builds algorithms to extract these attributes automatically.
x‑height
(defn x-height [font]
(/ (char-height font :x) (char-height font :A)))Stroke Contrast
(defn contrast [font]
(/ (char-area font :O) (char-bounding-box font :O)))Width Ratio
(defn width-ratio [font]
(mean [(/ (char-width font :M) (char-height font :M))
(/ (char-width font :N) (char-height font :N))]))Using these metrics he computes a Euclidean similarity score between fonts:
(defn similarity [x y & attrs]
(if (empty? attrs)
(recur x y [:x-height :contrast :width])
(euclidean-distance (map x attrs) (map y attrs))))
(similarity helvetica aktiv-grotesk [:x-height :contrast]) ;; etcOn a small test set the similarity ranking matches human intuition (e.g., Proxima Nova is closest to Gotham, while Didot is most different). He then runs the same analysis on over 800 Google Fonts, confirming that the algorithm consistently reflects perceived similarity.
Part 2: Rule‑Based System
Design rules such as optimal line length, color contrast, and avoiding "rivers" are encoded. Inspired by logic programming libraries ( core.logic, miniKanren), he creates a declarative, compositional rule engine.
Example Rules (Clojure)
(defn small-x-height? [font]
(<= (font :x-height) 0.75))
(defn too-similar? [a b min & attrs]
(>= min (similarity a b attrs)))
(defn legible-serif [font]
(and (= :serif (font :formality))
(not (small-x-height? font))))
(defn pair [library display]
(->> library
(filter legible-serif)
(filter (fn [body]
(not (too-similar? display body 0.35))))))These rules let designers query for fonts that satisfy high‑level constraints without naming specific typefaces.
Part 3: Macro Observation
He builds a large relational database of real‑world font usage by crawling sites like Font In Use and Typewolf. Visualising the data as node graphs reveals clusters of fonts that share attribute profiles, moving the analysis from name‑based to property‑based similarity.
Part 4: Micro Observation
Studying individual designers, studios, and design schools uncovers informal rules and community trends. By digitising these observations, algorithms can suggest font pairings, detect emerging trends, and provide designers with contextual recommendations.
Afterword
Having left The Grid in early 2016, the author reflects on the unfinished potential of the typographic AI system, noting that the prototype was limited to a single <input type="range"/> slider. He emphasizes that AI should augment designers, not replace them, and looks forward to a future of human‑computer symbiosis in design.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Aotu Lab
Aotu Lab, founded in October 2015, is a front-end engineering team serving multi-platform products. The articles in this public account are intended to share and discuss technology, reflecting only the personal views of Aotu Lab members and not the official stance of JD.com Technology.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
