Scalable Font Reconstruction with Dual Latent Manifolds

Nikita Srivatsan, Si Wu, Jonathan T. Barron, Taylor Berg-Kirkpatrick

Abstract

Typography faces a significant scalability challenge: while Unicode supports over 140,000 characters, most digital fonts cover only a small fraction, creating a "long tail" of missing glyphs for less common languages. We propose a generative factorization model that disentangles character structure from artistic style using dual latent manifolds. By treating font reconstruction as a matrix completion problem and utilizing a novel adaptive wavelet loss, our model generalizes to entirely new character types and scales to thousands of glyphs, significantly outperforming existing baselines in both quantitative metrics and human evaluation.

Introduction

The creation of a complete typeface is a massive undertaking, often requiring designers to manually craft thousands of characters. Consequently, most fonts are incomplete, lacking support for various scripts and symbols. This creates a digital divide where speakers of less widespread languages have limited typographic options. Existing automated methods often struggle with scale, either treating characters as fixed categories or failing to generalize to unseen character types.

The font reconstruction task viewed as a matrix completion problem where rows represent character types and columns represent font styles.

We address this by modeling the relationship between fonts and characters as a large, sparse matrix. Our goal is to "hallucinate" missing glyphs by understanding the underlying "skeleton" of a character and the stylistic "skin" of a font independently. This approach allows the model to predict what a character (e.g., a Greek letter) might look like in a specific style (e.g., bold Sans-Serif) even if it has never seen that specific combination before.

Methodology

The core of our approach is the Dual Latent Manifold framework. Unlike previous models that only treat font style as a latent variable, we assign latent variables to both the font ($Z_j$) and the character shape ($Y_i$).

Model Architecture

The system consists of three main components:

  1. Amortized Inference: A pair of convolutional encoders (one for characters, one for fonts) infers the latent variables from available glyphs. The font encoder, for instance, analyzes all available glyphs in a specific font to determine its stylistic parameters.
  2. HyperNetwork Decoder: The decoder uses the font style variable $Z_j$ to determine the weights of its convolutional layers. This "HyperNetwork" approach provides a strong inductive bias, allowing the style to effectively "filter" the character structure provided by $Y_i$.
  3. Adaptive Wavelet Loss: To avoid the blurriness associated with standard pixel-wise losses, we project images into a wavelet representation (CDF 9/7). We use an adaptive probability distribution that shifts between a heavy-tailed Cauchy distribution (for sharp edges) and a Normal distribution (for smooth areas).
Comprehensive overview of the Dual Latent Manifold architecture, showing the generative process, the transposed convolutional decoder, and the inference network.

Experimental Setup

We evaluated our model on three diverse datasets, preprocessed to remove near-duplicate fonts:

  • Google Fonts: Over 2,000 fonts covering the most frequent character types across multiple scripts (Latin, Greek, Cyrillic, Tamil).
  • Chinese Simplified: 623 fonts covering 2,000 common Chinese characters, incorporating radical labels for structural analysis.
  • Capitals64: A standard baseline consisting of 26 uppercase English letters.

Results and Key Insights

Our model consistently outperformed state-of-the-art baselines like Multi-content GAN (EMD) in Structural Similarity (SSIM) metrics, maintaining high performance even with minimal reference glyphs.

  • Generalization to Unseen Characters: A key strength of the dual manifold approach is its ability to generate characters not seen during training. On the Google Fonts dataset, the model achieved an SSIM of 0.830 for "unknown" characters, nearly matching its performance on "known" ones (0.834).
  • Structural Learning: t-SNE visualizations of the Chinese character embeddings revealed that the model naturally clusters characters by their radicals (e.g., the "water" radical 氵). This demonstrates that the manifold captures meaningful semantic and structural information.
  • Human Preference: In Amazon Mechanical Turk studies, human evaluators preferred our reconstructions over the EMD baseline approximately 50% of the time for both known and unknown characters, indicating high visual quality.

Discussion and Future Work

While the Dual Latent Manifold model represents a significant step forward in scalable font generation, some limitations remain. The model currently assumes conditional independence between glyphs, ignoring the inter-character relationships crucial for kerning and ligatures. Additionally, the output is in pixel space; future iterations could explore vector-based representations (TTF/OTF) to better align with professional design workflows. Despite these challenges, the ability to disentangle style and structure provides a robust foundation for universal typographic support.

Summary updated

BibTeX
@inproceedings{srivatsan2021scalable,
  author = {Nikita Srivatsan and Si Wu and Jonathan T. Barron and Taylor Berg-Kirkpatrick},
  title = {{Scalable Font Reconstruction with Dual Latent Manifolds}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.244},
}
Figure