TL;DR
CF-Font improves few-shot font generation by adaptively blending content features from multiple "basis fonts" and refining style vectors during inference. By introducing a projection-based loss that prioritizes character skeletons over pixel-perfect matching, the model produces significantly cleaner results for complex logographic characters like Chinese.
What Problem Does This Paper Address?
Creating a complete font for logographic languages is a monumental task. While English has 26 letters, Chinese requires over 60,000 characters. Few-shot font generation (FFG) aims to automate this by learning a new style from just a handful of reference images.
Most existing FFG methods rely on content and style disentanglement. They take a "content" feature from a standard source font (like Song or Kai) and try to wrap it in a "style" feature extracted from reference images. However, this disentanglement is rarely perfect. If the source font is structurally very different from the target (e.g., a thick source vs. a thin target), the model often fails to "forget" the source's characteristics, leading to artifacts like broken strokes or unwanted blobs.
Methods
The authors propose three novel components to bridge the gap between source and target domains:
- Content Fusion Module (CFM): Instead of relying on a single source font, CF-Font uses a set of "basis fonts" selected via clustering. For any target font, the module calculates adaptive weights based on similarity to these bases and blends their content features. This creates a tailored content representation that is structurally closer to the target. Visualization of content fusion
- Iterative Style-vector Refinement (ISR): Standard models typically average the style vectors of the few provided reference images. CF-Font treats this average as an initial guess and then performs a few iterations of backpropagation during the inference stage to fine-tune the style vector specifically for that target font. The framework of the model including ISR
- Projected Character Loss (PCL): Traditional pixel-wise losses (L1/L2) are easily confused by minor misalignments. PCL projects character images into multiple 1D probability distributions (histograms) along different axes. By minimizing the distance between these distributions, the model focuses on the global "skeleton" and topology of the character rather than just local pixel values. Illustration of PCL projections
Datasets
The researchers built a dataset of 300 Chinese fonts, encompassing both printed and handwritten styles.
- Character Set: 6,446 characters per font, covering the GB/T 2312 standard.
- Split: 240 fonts for training and 60 "unseen" fonts for testing generalization.
- Few-shot Setting: The model is evaluated using only 16 randomly picked reference characters for each target style.
Key Insights and Ideas
- Content is not Style-Neutral: A core insight is that the "content" feature extracted from a font still carries stylistic baggage. By using a linear combination of basis fonts, the model can find a "neutral" starting point that minimizes the difficulty of the style transfer.
- Skeleton Over Pixels: The success of PCL demonstrates that for fonts, structural integrity (the skeleton) is more important than per-pixel accuracy. As shown in Figure 5, PCL-based retrieval finds characters with much more consistent structures than L1-based retrieval. L1 vs PCL retrieval results
- Inference-Time Optimization: ISR shows that "learning" doesn't have to stop after training. A quick optimization step during deployment can significantly sharpen the stylistic details of the output.
Key Results
CF-Font consistently outperformed state-of-the-art (SOTA) methods like DG-Font and MX-Font across multiple metrics:
- Quantitative: On unseen fonts, it improved the L1 error by 5.7% and the FID (Fréchet Inception Distance) by 5.0% compared to the previous best method.
- Qualitative: Visual comparisons show that CF-Font avoids the "mismatched style" and "erroneous skeleton" issues that plague other models, especially in complex handwritten styles. Qualitative comparison with SOTA
- User Study: In a blind test with 20 participants, CF-Font was preferred 21.58% of the time, surpassing the second-place method (CG-GAN) by a large margin.
Limitations and Future Work
Despite its strengths, the model still struggles with extremely complex characters that have high stroke density and tight layouts, where it may occasionally miss strokes or produce structural errors.
The authors suggest that future work could explore vector font generation. Since vector characters are scale-invariant and mathematically defined by paths, they might offer a more robust way to handle the fine-grained details of complex logographic scripts.
Summary updated