Papers
Topics
Authors
Recent
Search
2000 character limit reached

DA-Font: Few-Shot Chinese Font Generation

Updated 4 July 2026
  • DA-Font is a few-shot font generation framework that creates new glyphs from a limited set of reference images while preserving the character’s content.
  • It employs a Dual-Attention Hybrid Module that integrates component attention for style consistency and relation attention for structural coherence.
  • The method demonstrates improved structural accuracy, local detail preservation, and fewer stroke errors compared to previous few-shot font generation techniques.

DA-Font is a few-shot font generation framework introduced for synthesizing new glyphs from a limited number of reference glyphs. In the reported setting, the model receives a small set of reference glyph images x={x1,,xk}x=\{x_1,\dots,x_k\} from a target style and a content image IcI_c, and produces a glyph IoI_o that preserves the content or character identity of IcI_c while adopting the style of the reference set. Its defining mechanism is the Dual-Attention Hybrid Module (DAHM), which combines a component attention block and a relation attention block in order to preserve accurate character shapes and stylistic textures; the paper further introduces a corner consistency loss and an elastic mesh feature loss to improve geometric alignment (Chen et al., 20 Sep 2025).

1. Problem formulation and intended scope

DA-Font addresses few-shot font generation, a setting in which a target font style must be inferred from only a small number of exemplars. The paper states that this is especially important for scripts such as Chinese, Japanese, and Korean, where manually designing thousands of characters per font is expensive. In its experimental configuration, the method is evaluated on Chinese fonts and uses four reference images during generation (Chen et al., 20 Sep 2025).

The stated motivation is that existing few-shot methods often suffer from visible defects, including stroke errors, artifacts, blurriness, and structural inconsistencies. The paper attributes these failures to the difficulty of preserving three properties simultaneously: global character structure, local style details, and component-level consistency. DA-Font is presented as a response to the claim that earlier methods often do not use component information effectively to mediate interactions between content and style features. In this formulation, component information is not merely descriptive; it is used to guide feature interaction during style transfer (Chen et al., 20 Sep 2025).

The model represents content with a structural feature map fcf_c extracted from the content image IcI_c, style with reference features fs={f1,,fk}f_s=\{f_1,\dots,f_k\} extracted from the few style exemplars, and component structure with a component-wise codebook FcF_c learned by a pre-trained VQ-VAE content encoder. This design places DA-Font within the few-shot font generation literature rather than within font recognition or retrieval systems.

2. Learned representations and feature decomposition

Before training the main generator, DA-Font pre-trains its content encoder using a glyph reconstruction network. The content encoder maps a glyph image IfI_f to a latent representation ZcZ_c, after which vector quantization replaces each latent vector by its nearest codebook entry:

IcI_c0

Here IcI_c1 is the IcI_c2-th latent vector in IcI_c3, IcI_c4 is the IcI_c5-th codebook entry, and IcI_c6 is the codebook with IcI_c7 code vectors (Chen et al., 20 Sep 2025).

The pretraining objective is

IcI_c8

with IcI_c9 and IoI_o0. After this stage, IoI_o1 and the codebook IoI_o2 are fixed for the main model. The paper characterizes the resulting representation as a discrete component-oriented representation of glyph structure (Chen et al., 20 Sep 2025).

In parallel, a reference encoder IoI_o3 encodes the IoI_o4 reference glyphs into style latent features

IoI_o5

DA-Font also includes a content alignment module, motivated by the observation that some reference glyphs may share more structural similarity with the target content than others. The module extracts content features IoI_o6 from the reference glyphs via IoI_o7, computes normalized cross-correlation channel-wise with the target content feature IoI_o8, softmax-normalizes the similarities, and uses them to aggregate the style channels into a content-aware aligned feature IoI_o9 (Chen et al., 20 Sep 2025).

This decomposition yields three distinct inputs to the downstream generator: the content feature IcI_c0, the content-aligned style feature IcI_c1, and the codebook-derived component information IcI_c2. A plausible implication is that DA-Font treats character generation as a structured fusion problem rather than as flat concatenation of content and style embeddings.

3. Dual-Attention Hybrid Module

The Dual-Attention Hybrid Module is the central architectural contribution. It contains two blocks with different roles. The component attention block produces a stylized component codebook IcI_c3 by using the content codebook IcI_c4 to query the style features IcI_c5. The relation attention block then uses the content feature IcI_c6 to query relations between the original component codebook IcI_c7 and the stylized codebook IcI_c8, producing a refined style representation IcI_c9 (Chen et al., 20 Sep 2025).

Component attention block

The inputs are the component-wise codebook

fcf_c0

and the style features fcf_c1. The style features are reshaped and concatenated along the spatial dimension into

fcf_c2

The block is implemented as a multi-head transformer with fcf_c3 heads. For head fcf_c4,

fcf_c5

fcf_c6

fcf_c7

The attention output is

fcf_c8

followed by

fcf_c9

This makes the component codebook the query and the reference style features the key/value set, so each learned component prototype selectively retrieves style evidence from the exemplars (Chen et al., 20 Sep 2025).

The block then applies Graph Feature Propagation. For components IcI_c0 and IcI_c1 in IcI_c2, the adjacency matrix is

IcI_c3

and an auxiliary score matrix is

IcI_c4

The refined codebook is

IcI_c5

and the stylized codebook becomes

IcI_c6

The paper interprets this as component-wise style transfer followed by interaction propagation across components (Chen et al., 20 Sep 2025).

Relation attention block

The relation attention block takes IcI_c7, IcI_c8, and IcI_c9 as input and outputs

fs={f1,,fk}f_s=\{f_1,\dots,f_k\}0

The content feature map is reshaped into

fs={f1,,fk}f_s=\{f_1,\dots,f_k\}1

and for attention head fs={f1,,fk}f_s=\{f_1,\dots,f_k\}2,

fs={f1,,fk}f_s=\{f_1,\dots,f_k\}3

fs={f1,,fk}f_s=\{f_1,\dots,f_k\}4

fs={f1,,fk}f_s=\{f_1,\dots,f_k\}5

Thus the content feature is the query, the original codebook is the key, and the stylized codebook is the value (Chen et al., 20 Sep 2025).

Before attention, the paper applies a Local Feature Refiner to fs={f1,,fk}f_s=\{f_1,\dots,f_k\}6 and fs={f1,,fk}f_s=\{f_1,\dots,f_k\}7. The importance of pixel fs={f1,,fk}f_s=\{f_1,\dots,f_k\}8 in region fs={f1,,fk}f_s=\{f_1,\dots,f_k\}9 is defined as

FcF_c0

and the refiner is implemented by stacking a SoftPool operation followed by a FcF_c1 convolution. The paper also uses stride and squeeze convolutions to enlarge receptive field, sigmoid and linear interpolation for rescaling, and a gating mechanism:

FcF_c2

The attention output is then

FcF_c3

and after multi-head aggregation,

FcF_c4

with FcF_c5. Reshaping FcF_c6 back to spatial form yields FcF_c7 (Chen et al., 20 Sep 2025).

The full generator uses the concatenation FcF_c8 as decoder input. In the paper’s interpretation, the component attention block improves style consistency and radical alignment, while the relation attention block refines spatial dependency modeling and structural coherence.

4. Objective functions and optimization

DA-Font combines adversarial, reconstruction, contrastive, and geometry-oriented losses. A multi-task discriminator FcF_c9 is used for adversarial real/fake discrimination as well as style and content classification (Chen et al., 20 Sep 2025).

The adversarial losses are

IfI_f0

and

IfI_f1

The matching losses include an image-space IfI_f2 term

IfI_f3

and a discriminator feature-matching term

IfI_f4

The paper states that the image loss improves pixel fidelity and the feature matching loss stabilizes GAN training and reduces mode collapse (Chen et al., 20 Sep 2025).

To make style representations discriminative while ignoring reference content, the model uses a style contrast loss:

IfI_f5

Here IfI_f6 denotes positive samples with the same style and different content, and IfI_f7 denotes negative samples with the same content and different styles (Chen et al., 20 Sep 2025).

Two additional losses explicitly target geometric alignment. The corner consistency loss uses Shi-Tomasi corner detection:

IfI_f8

The elastic mesh feature loss is

IfI_f9

The paper describes the first as preserving critical junction points and the second as preserving local structural consistency and topological coherence (Chen et al., 20 Sep 2025).

The full objective is

ZcZ_c0

with

ZcZ_c1

Training is divided into two stages. In stage 1, the decomposition network is pretrained on 3000 Chinese characters in the font kai, with embedding dimension 256, codebook size 100, batch size 64, and 50,000 iterations. In stage 2, the full model is trained with Adam, batch size 8, generator learning rate ZcZ_c2, discriminator learning rate ZcZ_c3, and 600,000 iterations (Chen et al., 20 Sep 2025).

5. Experimental protocol and empirical results

The experiments use a collected Chinese font dataset containing 575 fonts and 3500 commonly used Chinese characters per font at resolution ZcZ_c4. The font kai is fixed as the content font for both training and testing, and is also used to pretrain the decomposition network. The training set, denoted SFSC, contains 550 fonts and 3000 characters per font. Two test settings are reported: UFUC, with 24 unseen fonts and 500 unseen characters per font, and SFUC, with 550 seen fonts and 500 unseen characters per font (Chen et al., 20 Sep 2025).

The paper compares DA-Font against FUNIT, MX-Font, DG-Font, LF-Font, CF-Font, VQ-Font, FontDiffuser, and IF-Font. Evaluation uses SSIM, RMSE, LPIPS, FID, ZcZ_c5, and a user study (Chen et al., 20 Sep 2025).

Setting SSIM / RMSE / LPIPS / FID / L1 User study
UFUC 0.7352 / 0.2854 / 0.1699 / 54.1856 / 0.0872 20.10%
SFUC 0.7287 / 0.3019 / 0.1792 / 49.2237 / 0.1116 17.85%

On UFUC, DA-Font improves over IF-Font from SSIM 0.6891 to 0.7352, RMSE 0.3130 to 0.2854, LPIPS 0.2173 to 0.1699, FID 59.6292 to 54.1856, ZcZ_c6 0.1038 to 0.0872, and user preference 14.15% to 20.10%. Compared with VQ-Font on UFUC, SSIM improves from 0.6776 to 0.7352, RMSE from 0.3066 to 0.2854, LPIPS from 0.2157 to 0.1699, and FID from 58.2632 to 54.1856. On SFUC, DA-Font improves over IF-Font from SSIM 0.6652 to 0.7287, RMSE 0.3280 to 0.3019, LPIPS 0.2221 to 0.1792, FID 62.8246 to 49.2237, ZcZ_c7 0.1213 to 0.1116, and user preference 14.60% to 17.85% (Chen et al., 20 Sep 2025).

The qualitative analysis states that DA-Font produces better structural correctness, better local detail preservation, more accurate style texture transfer, fewer missing or redundant strokes, less blurriness, and fewer artifacts. Baseline failures are described specifically: FUNIT is said to be structurally incomplete unless source and target fonts are already similar; MX-Font and LF-Font preserve rough shape but produce blurry textures; DG-Font struggles with intricate local details; CF-Font often introduces artifacts and style inconsistencies; VQ-Font is described as relatively stable but weaker in local control; IF-Font and FontDiffuser remain strong overall but still show visible stroke errors in some cases (Chen et al., 20 Sep 2025).

The ablation study attributes a large part of the performance gain to DAHM. On UFUC, the base model reports SSIM 0.6531, RMSE 0.3197, LPIPS 0.2236, and FID 60.6758. Adding the component attention block improves these to SSIM 0.7084, RMSE 0.2982, LPIPS 0.1829, and FID 57.6571. Adding both component and relation attention yields SSIM 0.7352, RMSE 0.2854, LPIPS 0.1699, and FID 54.1856. A second ablation shows that using both ZcZ_c8 and ZcZ_c9 is better than omitting either one. The paper also reports that codebook size 100 offers a good tradeoff, and that performance improves as the number of reference images increases from 1 to 4, with marginal gains beyond 4 (Chen et al., 20 Sep 2025).

The paper does not provide a dedicated failure-case section. It does, however, make clear that the reported experiments are confined to Chinese fonts, that the content font is fixed to kai, and that multilingual generalization and lightweight or real-time deployment are left for future work. This suggests that the method is currently best understood as a high-fidelity, script-specific few-shot generator rather than as a universal multilingual font system.

6. Position within the research landscape

DA-Font belongs to a line of work on few-shot font generation rather than to the line on font recognition. This distinction matters because the font literature also includes recognition systems such as DeepFont, which addressed visual font recognition with synthetic-to-real domain adaptation and large-scale font classification rather than glyph synthesis (Wang et al., 2015).

Within few-shot generation, DA-Font is closely related to several neighboring formulations but differs in its emphasis. DM-Font uses compositionality in glyph-rich scripts through a Dual Memory-augmented Font Generation Network, separating persistent memory for style-independent component priors and dynamic memory for style-specific component features (Cha et al., 2020). DS-Font reframes few-shot font generation around learning the Difference between different styles and the Similarity of the same style via a multi-layer style projector, a cluster-level contrastive style loss, and a multi-task patch discriminator (He et al., 2023). Scalable Font Reconstruction with Dual Latent Manifolds learns separate latent variables for character shape and font style in order to scale to sparse multilingual character sets and to generalize to characters not observed during training time (Srivatsan et al., 2021).

Against that background, DA-Font’s specific contribution is to make component structure an active guide for style transfer through DAHM. The component attention block uses the content-side component codebook to query style features, and the relation attention block uses content features to mediate interactions between the original and stylized component-wise representations. The paper’s interpretation is that this dual design improves both structural integrity and local fidelity, and its empirical results are presented as evidence that it outperforms state-of-the-art methods across diverse font styles and characters (Chen et al., 20 Sep 2025).

A common ambiguity in the broader literature is that the abbreviation “DA” can denote domain adaptation in recognition papers, while DA-Font denotes Dual-Attention Hybrid Integration in a generation paper. The two uses belong to different problem settings. In the present context, DA-Font refers specifically to a few-shot Chinese font generation framework whose principal innovations are DAHM, corner consistency loss, and elastic mesh feature loss.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to DA-Font.