Embedding Fonts with Neural Networks: When a Font Map Blooms into a Flower

Neural network font embeddings unexpectedly map a font corpus into a flower-shaped tSNE visualization.
A developer building a font search tool discovered that his pre-trained neural network embeddings could map an entire font corpus into a visually striking spatial structure. Glyphs are rendered as images, passed through a custom network to generate high-dimensional embeddings, then reduced via tSNE and mapped to both XYZ coordinates and RGB color. The Google Fonts result was most stunning — forming a flower shape with cursive fonts naturally clustering at the stamen. This structure emerged organically from tSNE's local similarity preservation, not deliberate design. The project also demonstrates the practical value of visual embeddings for font retrieval, enabling "find fonts that look like this" beyond manual tags. Code is open source.
An Unexpected Surprise from a Font Search Project
A developer shared on Reddit a font search tool project he had been working on for about a year. The core idea was to use a neural network to generate embedding vectors for each font, then adapt those vectors for font retrieval tasks. The result that excited him most, however, wasn't the retrieval-optimized model — it came from the pre-trained model itself. Unexpectedly, these models mapped the entire font corpus into a visually striking structure, with one particularly famous output resembling a flower.

What makes this case compelling is how it demonstrates the intuitive expressive power of embeddings on visual data. When we compress the abstract notion of "font style" into points that can be positioned in space, the similarities and differences between fonts become visible as geometric relationships.
Technical Breakdown: From Glyphs to Visualization
The pipeline the author describes is quite clear and can be broken into several stages:
1. Glyph-to-Image Rendering
Each glyph in a font is rendered as an image. This step converts vector or outline information into pixel-level input that a neural network can process.
2. Custom Pre-trained Network for Embedding Generation
These glyph images are fed into the author's own pre-trained neural network, which outputs an embedding vector representing the visual characteristics of that font. An embedding vector is essentially a high-dimensional numerical summary of what a font "looks like" — visual attributes such as stroke weight, presence of serifs, curvature, and slant are all encoded within it.
Embeddings are the core output of representation learning. The fundamental idea is to map high-dimensional, discrete, or hard-to-compute objects (text, images, fonts, etc.) into low-dimensional continuous dense vectors, such that semantically or visually similar objects are closer together in vector space. This technique was widely popularized in NLP with Word2Vec (2013) and has since been applied to images, audio, code, and virtually every other modality. In computer vision, the common approach is to encode images with a CNN or Vision Transformer, using activations from an intermediate or final layer as the embedding. Pre-training typically occurs in a self-supervised manner on large-scale unlabeled or weakly labeled data, allowing the model to discover the underlying structure on its own; for specific downstream tasks like retrieval or classification, fine-tuning follows. The reason the pre-trained font embeddings produce meaningful geometric structures is precisely because the network, during training, was forced to represent visually similar glyphs as spatially adjacent vectors.
3. Dimensionality Reduction and Visualization
High-dimensional embeddings can't be observed directly, so the author experimented with three dimensionality reduction methods — PCA, UMAP, and tSNE — ultimately concluding that tSNE produced the best structure. He mapped the reduced results simultaneously onto XYZ spatial coordinates and RGB color channels, turning each font into a colored point in space.
There's a clever design choice here: both spatial proximity and color similarity indicate visual feature similarity. This dual encoding lets observers identify clustering relationships through both position and color, tracking the small clusters and pathways formed by different font types across the map.
PCA, UMAP, and tSNE are the three most commonly used methods for dimensionality reduction of high-dimensional data, each with different strengths. PCA is a linear method that preserves the directions of greatest global variance — fast to compute but limited in expressing nonlinear structures. tSNE (t-distributed Stochastic Neighbor Embedding) is a nonlinear method known for preserving local neighborhood structure: by minimizing the difference between probability distributions of point pairs in high- and low-dimensional space, it pulls similar samples together and pushes dissimilar ones apart, making it particularly good at revealing cluster structures — though global distances (relative positions between different clusters) are not strictly comparable. UMAP differs from tSNE mathematically, runs faster, and better preserves global structure; it has increasingly become the go-to choice for large-scale datasets in recent years. The author's finding that tSNE performed best aligns well with the nature of font data: fonts naturally form several highly cohesive visual categories (serif, handwritten, monospace, etc.), and tSNE's local clustering behavior is perfectly suited to clearly separating these categories.
Why It Looks Like a Flower
The map the author generated from the Google Fonts corpus was his favorite — and it turned out to have a flower-like structure that exceeded his own expectations. Even more interestingly, the model clustered most cursive/handwritten fonts into the position of the flower's stamen.
This wasn't a deliberate design choice. It emerged naturally from the dimensionality reduction algorithm as it preserved local data structure. tSNE tends to pull similar samples closer and push dissimilar ones apart; when the distribution of visual features in the font data itself follows a pattern of continuous transition with central clustering, a petal-like radial structure can naturally emerge in 2D or 3D projection. Cursive fonts, as a group that is visually highly cohesive yet clearly distinct from other categories, were placed at the structural center — exactly where the stamen would be.
This kind of "emergent beauty" is actually a common phenomenon in embedding visualizations: handwritten digits, faces, word vectors, and other data types also frequently produce intuitive and interpretable spatial layouts after dimensionality reduction. The font flower is simply a particularly photogenic example.
Interactive Results to Explore
The author has made two interactive maps available: one based on the Google Fonts corpus (the flower), and one covering all fonts searchable on his website. Curious readers can explore the full structure at font-search.com/map, zooming in to examine font clusters in different regions.
The code repository is also open source (dylan-berndt/Briefcase), though the author candidly admits it's "a mess." This is an honest heads-up for anyone looking to reproduce the approach: engineering cleanliness in research side projects often takes a back seat to exploration speed.
A Few Thoughts on Practical Applications
Beyond the novelty of the flower shape, the methodology behind this project has genuine value for font retrieval. Traditional font search relies on tags, names, or categorical labels, whereas visual embedding-based retrieval can directly enable "find fonts that look like this one" — breaking free from the limitations of manual tagging. The pre-trained embedding space itself serves as a measurable similarity foundation; post-training fine-tuning for specific search tasks can then bring it to production.
Methodologically, this is also a textbook example of transplanting a mature representation learning paradigm into a niche vertical domain: glyph images → visual embeddings → dimensionality reduction / retrieval. It requires no new theoretical breakthroughs — just the domain understanding to apply existing tools in the right place. For anyone looking to build similarity search in a specialized field, this pipeline offers a clear and replicable reference.
It's worth noting that all of the above is based on a single source (the author's own Reddit post), and specific details such as network architecture, training data scale, and retrieval performance metrics have not been disclosed.
Related articles

Chain of Thought Isn't Just for AI: How Humans Can Use CoT to Improve Thinking Quality
Chain of Thought isn't just a prompt trick for large models. Starting from a Hacker News discussion, this article analyzes why CoT works for human thinking too, breaks down actionable ways to transfer it, and highlights the key differences between human CoT and machine CoT.
Cloudflare Teams Up with OpenAI: Closi…
Cloudflare Teams Up with OpenAI: Closing the Loop from Vulnerability Discovery to Defense with AI
Cloudflare uses OpenAI Daybreak to investigate security vulnerabilities and generate reviewable remediation plans, while developers use Codex to boost coding efficiency and quality.

Orca Multi-Agent Orchestration in Practice: A Guide to Parallel Collaboration with Claude and Codex
Orca is Stable AI's free open-source agent workbench supporting 34 agents like Claude Code and Codex in parallel. Learn its Git worktree isolation, multi-model orchestration, and mobile management.