GlyphGAN: Style-consistent font generation based on generative adversarial networks

Hideaki Hayashi, Kohtaro Abe, Seiichi Uchida

Abstract

Font design is a labor-intensive process requiring visual consistency across an entire character set. We present GlyphGAN, a framework based on Generative Adversarial Networks (GANs) that automates font generation by decoupling style from character identity. By utilizing a split latent space and Wasserstein GAN with Gradient Penalty (WGAN-GP), GlyphGAN generates diverse, legible, and style-consistent fonts without requiring reference images. Experimental results demonstrate high classification accuracy and superior style consistency compared to baseline models.

Introduction

Designing a new font is an exhausting, manual process. For the Latin alphabet, a designer must create at least 52 consistent upper- and lower-case letters; for logographic languages like Japanese or Chinese, that number climbs into the thousands. While machine learning has attempted to automate this, previous approaches faced two major hurdles: maintaining style consistency (ensuring every character shares the same visual "DNA") and dependency on reference images (requiring a human-designed 'A' to generate the rest of the set).

GlyphGAN addresses these challenges by creating a system that can generate brand-new, legible fonts independently while maintaining a cohesive look across the entire alphabet.

Figure 1: Examples of the diverse font styles and ornamentations that GlyphGAN aims to capture and generate consistently across character sets.

Methods

GlyphGAN builds upon the Deep Convolutional GAN (DCGAN) architecture but introduces a specific input structure to handle the dual nature of fonts.

Latent Space Decoupling

The input to the Generator is split into two distinct parts:

  • Style Vector ($z^s$): A 100-dimensional random vector that determines the visual characteristics (e.g., weight, serifs, ornamentation).
  • Character Class Vector ($z^c$): A one-hot encoded vector representing the specific letter identity (A, B, C, etc.).

By fixing the style vector and varying the character vector, the model can produce a full, consistent alphabet. Conversely, fixing the character and sweeping the style vector allows for the exploration of infinite design variations for a single letter.

Training Stability

To avoid "mode collapse"—a common GAN failure where the generator produces limited varieties of output—the authors employed Wasserstein GAN with Gradient Penalty (WGAN-GP). This provides more stable training and ensures the model learns the distinct topological features of each letter, maintaining legibility even in highly stylized outputs.

Datasets and Experimental Setup

The model was trained on a dataset of 6,561 different fonts, focusing on the 26 uppercase letters of the Latin alphabet. Each character was rendered as a $64 \times 64$ grayscale bitmap. Notably, the researchers did not normalize font sizes, treating size variations as an inherent characteristic of the font styles themselves.

Results and Key Insights

GlyphGAN demonstrates significant improvements over baseline models in three key areas:

  1. High Legibility: To verify readability, generated letters were processed by a pre-trained CNN classifier. GlyphGAN achieved 83.90% accuracy, vastly outperforming standard DCGAN (3.9%) and previous MLP-based models (72.51%).
  2. Style Consistency: Using a custom metric ($C_s$) to measure intra-style variation, the authors proved that GlyphGAN maintains tighter visual cohesion across an alphabet than previous methods.
  3. Design Manifold: The model learns a continuous mathematical space of font designs. This allows for style interpolation, where a user can find the midpoint between two styles (e.g., thin and thick) to generate a perfectly legible "medium" font that may not have existed in the training data.

Conclusion and Future Work

While GlyphGAN successfully generates style-consistent bitmap fonts, several avenues for future research remain. The current $64 \times 64$ resolution is insufficient for professional typography, which relies on vector-based mathematical curves. Additionally, expanding the model to handle the thousands of characters in CJK languages would require significantly more computational power. Future iterations may also focus on mapping the latent style space to human-understandable attributes, allowing designers to explicitly control features like "boldness" or "italicization."

Summary updated

Abstract

In this paper, we propose GlyphGAN: style-consistent font generation based on generative adversarial networks (GANs). GANs are a framework for learning a generative model using a system of two neural networks competing with each other. One network generates synthetic images from random input vectors, and the other discriminates between synthetic and real images. The motivation of this study is to create new fonts using the GAN framework while maintaining style consistency over all characters. In GlyphGAN, the input vector for the generator network consists of two vectors: character class vector and style vector. The former is a one-hot vector and is associated with the character class of each sample image during training. The latter is a uniform random vector without supervised information. In this way, GlyphGAN can generate an infinite variety of fonts with the character and style independently controlled. Experimental results showed that fonts generated by GlyphGAN have style consistency and diversity different from the training images without losing their legibility.
BibTeX
@article{hayashi2019glyphgan,
  author = {Hideaki Hayashi and Kohtaro Abe and Seiichi Uchida},
  title = {{GlyphGAN: Style-consistent font generation based on generative adversarial networks}},
  journal = {Knowledge-Based Systems},
  year = {2019},
  doi = {10.1016/j.knosys.2019.104927},
}
Figure