Abstract
Automatic font generation without human experts is a practical and significant problem, especially for some languages that consist of a large number of characters. Existing methods for font generation are often in supervised learning. They require a large number of paired data, which are labor-intensive and expensive to collect. In contrast, common unsupervised image-to-image translation methods are not applicable to font generation, as they often define style as the set of textures and colors. In this work, we propose a robust deformable generative network for unsupervised font generation (abbreviated as DGFont++). We introduce a feature deformation skip connection (FDSC) to learn local patterns and geometric transformations between fonts. The FDSC predicts pairs of displacement maps and employs the predicted maps to apply deformable convolution to the low-level content feature maps. The outputs of FDSC are fed into a mixer to generate final results. Moreover, we introduce contrastive self-supervised learning to learn a robust style representation for fonts by understanding the similarity and dissimilarities of fonts. To distinguish different styles, we train our model with a multi-task discriminator, which ensures that each style can be discriminated independently. In addition to adversarial loss, another two reconstruction losses are adopted to constrain the domain-invariant characteristics between generated images and content images. Taking advantage of FDSC and the adopted loss functions, our model is able to maintain spatial information and generates high-quality character images in an unsupervised manner. Experiments demonstrate that our model is able to generate character images of higher quality than state-of-the-art methods.
Introduction
Creating a full font library for logographic languages like Chinese is a monumental task, often requiring experts to hand-draw over 60,000 individual characters. While AI can help, most existing models rely on supervised learning, which requires "paired data"—the same character drawn in two different styles. Collecting thousands of these pairs is labor-intensive and expensive.
Existing unsupervised image-to-image translation models (like CycleGAN) often fail in this domain because they define "style" as a set of colors or textures. In typography, style is defined by geometry: stroke thickness, the sharp tip of a brush, or the way lines join. Standard models often "smear" these details or lose the character's structure entirely. DGFont++ aims to bridge this gap by focusing on spatial deformation.
Methodology
The authors introduce several architectural innovations to handle the "shape-shifting" nature of fonts:
- Feature Deformation Skip Connection (FDSC): Instead of just passing features through the network, FDSC predicts "displacement maps." These maps tell the model how to warp low-level content features to match the target style's geometry, ensuring fine details are preserved.
- FDSC-attn: An evolution of the FDSC that integrates local spatial attention. This allows the model to look at neighboring pixels to decide how a specific part of a stroke should be deformed, leading to smoother results.
- Contrastive Style Learning: To learn a robust representation of a font style, the model uses a contrastive approach. It learns to recognize that different characters from the same font should have similar style vectors, while characters from different fonts should be distinct.
- Multi-task Discriminator: Rather than one global check, the discriminator is trained to identify specific styles independently, ensuring the generator doesn't "leak" styles from one font into another.
Key Insights: Style as Deformation
The core innovation is that font generation is a spatial warping problem, not a texture-filling problem. By using deformable convolutions in the skip connections, the model can "stretch" and "bend" strokes without breaking them.
Applying FDSC to low-level feature maps is key; warping high-level, abstract features often leads to blurry results. By focusing on low-level maps, the "bones" of the character remain sharp. Furthermore, using contrastive learning allows the model to handle "few-shot" scenarios much more effectively by creating a more organized latent space for styles.
Results and Evaluation
The researchers curated a dataset of 231 distinct Chinese fonts. DGFont++ was compared against state-of-the-art methods like MXFont, FUNIT, and CycleGAN:
- Quantitative: On 128x128 images of unseen fonts, DGFont++ achieved a Frechet Inception Distance (FID) of 34.54, significantly better than MXFont (39.61) and FUNIT (35.76).
- Qualitative: The model excels at challenging cases like hollow WordArt or highly cursive calligraphy where other models often produce noisy or incomplete characters.
- User Study: In a blind test, human participants preferred the results of DGFont++ over 80% of the time when compared to older supervised methods like Zi2zi.
Conclusion and Future Work
While DGFont++ is a major step forward, challenges remain in optimization complexity due to the non-unique nature of deformable grids. Extremely abstract or "broken" artistic fonts might still pose a challenge for maintaining character legibility. Future work could explore extending these principles to other complex scripts like Arabic or Indic languages.
Summary updated