One-shot Font Generation (OFG) aims to synthesize a target glyph by transferring the stylistic characteristics of a single reference glyph while preserving the structure of the target character. However, accurately capturing font style from a single reference image remains challenging due to the limited stylistic information available in a single glyph, and this challenge is further amplified for complex scripts. We propose CoDeFont, a script-agnostic OFG framework that addresses this challenge through multi-level style-content factorization and progressive style-content reconciliation. CoDeFont independently aggregates complementary style and structural information across multiple spatial levels to obtain factor-specific representations, while a contrastive objective explicitly encourages separation between style and content embeddings. During reconstruction, the disentangled representations are progressively injected through multi-level style conditioning, enabling stylistic information to be incorporated at different decoding resolutions while preserving the underlying glyph structure. We evaluate CoDeFont on structurally distinct Bengali and Latin scripts across seen and unseen font styles. Extensive quantitative and qualitative analyses demonstrate consistent improvements over existing state-of-the-art methods, highlighting the effectiveness of the proposed framework for OFG across diverse writing systems.
Figures & tables
Figure 1: Overview of the proposed CoDeFont . The generator independently encodes the style reference xs and content reference xc using the Style Encoder Es and Content Encoder Ec to obtain style embedding es and content embedding ec , respectively. The factorized representations are progressively reconciled in the Decoder Dsc to generate the target glyph y^ . The Discriminator provides adversarial supervision and jointly performs auxiliary style and content classification, encouraging style consistency and content preservation.
Figure 2: Architectural overview of the proposed Style Encoder Es . Given a style image xs , the encoder extracts multi-scale style features through parallel convolutional branches with different kernel sizes and fuses them into a unified representation. The fused features are then processed by the Style-Query Attention Head (SQAH) to obtain the final style embedding es .
Figure 3: Architecture of the proposed Content Encoder Ec . Given a content image xc , the encoder extracts multi-scale features through successive convolutional blocks. The three downsampling features are processed by the Content Pooling Head (CPH) and adaptively fused using learnable scale weights to obtain the final content embedding ec .
Figure 4: Architecture of the proposed Decoder Dsc . The decoder projects the content embedding into a low-resolution latent feature map and progressively upsamples it through the Multi-level Adaptive Style Fusion Module (MASFM) , which injects style information at multiple decoding levels using AdaIN [ 8 ] and channel-wise gating. The refined features are finally mapped to the target glyph y^ through a convolutional output layer.
Unseen Fonts
Seen Fonts
Method
L1 ↓
RMSE ↓
SSIM ↑
LPIPS ↓
L1 ↓
RMSE ↓
SSIM ↑
LPIPS ↓
User Score ↑
Bengali
FANnet [ 20 ]
0.027
0.118
0.903
0.092
0.023
0.108
0.926
0.084
3.333
MA-Font [ 17 ]
0.032
0.148
0.893
0.071
0.030
0.145
0.896
0.069
1.795
PatchFont [ 14 ]
0.042
0.181
0.836
0.057
0.041
0.178
0.842
0.053
3.590
FontDiffuser [ 31 ]
0.020
0.094
0.912
0.047
0.014
0.067
0.954
0.043
43.846
Table 1: Quantitative comparison with existing SOTA methods on Unseen and Seen Bengali and Latin fonts. The top and bottom sections correspond to Bengali and Latin, respectively. The best and second-best results are highlighted in bold and underlined .
Figure 5: Qualitative comparison of our proposed method with existing SOTA techniques on Unseen and Seen Bengali and Latin fonts. The top and bottom sections correspond to Bengali and Latin, respectively. Red boxes highlight major failures, including poor style adaptation, structural deformation, and missing strokes, while blue boxes indicate minor artifacts and structural inconsistencies for existing methods.
Method
#Parameters ↓
FANnet [ 20 ]
4.2M
MA-Font [ 17 ]
34.4M
PatchFont [ 14 ]
51.3M
FontDiffuser [ 31 ]
323.2M
FASTER [ 5 ]
82.9M
Proposed
73.5M
Table 2: Comparative analysis of SOTA methods on the number of trainable parameters.
Figure 6: The t-SNE [ 25 ] visualization of the style ( es ) and content ( ec ) embeddings, illustrating their factor-specific clustering.
es by Style
es by Content
ec by Style
ec by Content
0.695
-0.055
-0.017
0.999
Table 3: Silhouette scores of the style and content embeddings under different label assignments
Emb. Dim.
L1 ↓
RMSE ↓
SSIM ↑
LPIPS ↓
32
0.018
0.095
0.945
0.033
64
0.017
0.090
0.949
0.030
128
0.017
0.091
0.948
0.031
256
0.018
0.096
0.944
0.034
512
0.033
0.151
0.886
0.077
Table 4: Effect of embedding dimension on the performance of our proposed method. Best results are shown in bold .
Loss Function
Metrics
Ldist
Lcls
L1 ↓
RMSE ↓
SSIM ↑
LPIPS ↓
✗
✗
0.034
0.251
0.852
0.153
✗
✓
0.029
0.219
0.874
0.132
✓
✗
0.022
0.168
0.885
0.072
✓
✓
0.017
0.090
0.949
0.030
Table 5: Quantitative analysis of the effectiveness of Lcls and Ldist on the generation quality. Better results are shown in bold .
Gating
L1 ↓
RMSE ↓
SSIM ↑
LPIPS ↓
✗
0.019
0.097
0.938
0.038
✓
0.017
0.090
0.949
0.030
Table 6: Effect of gating mechanism on the performance of our proposed method. Better results are shown in bold .
MS Feature
Metrics
Es
Ec
L1 ↓
RMSE ↓
SSIM ↑
LPIPS ↓
✗
✗
0.029
0.192
0.932
0.121
✗
✓
0.021
0.154
0.939
0.075
✓
✗
0.019
0.108
0.943
0.054
✓
✓
0.017
0.090
0.949
0.030
Table 7: Quantitative analysis of the effectiveness of multi-scale (MS) features in the style encoders Es and Ec on generation quality. Best results are shown in bold .
Few-shot Font Generation aims to generate stylistically consistent glyphs from a few reference glyphs. However, capturing complex font styles from a few exemplars remains challenging, and the existing methods often struggle to retain discernible local characteristics in generated samples. This paper introduces DRG-Font, a contrastive font generation strategy that learns complex glyph attributes by decomposing style and content embedding spaces. For optimal style supervision, the proposed architecture incorporates a Reference Selection (RS) Module to dynamically select the best style reference from an available pool of candidates. The network learns to decompose glyph attributes into style and shape priors through a Multi-scale Style Head Block (MSHB) and a Multi-scale Content Head Block (MCHB). For style adaptation, a Multi-Fusion Upsampling Block (MFUB) produces the target glyph by combining the reference style prior and target content prior. The proposed method demonstrates significant improvements over state-of-the-art approaches across multiple visual and analytical benchmarks.
Few-shot Chinese font generation aims to synthesize new characters in a target style using only a handful of reference images. Achieving accurate content rendering and faithful style transfer requires effective disentanglement between content and style. However, existing approaches achieve only feature-level disentanglement, allowing the generator to re-entangle these features, leading to content distortion and degraded style fidelity. We propose the Structure-Level Disentangled Diffusion Model (SLD-Font), which receives content and style information from two separate channels. SimSun-style images are used as content templates and concatenated with noisy latent features as the input. Style features extracted by a CLIP model from target-style images are integrated via cross-attention. Additionally, we train a Background Noise Removal module in the pixel space to remove background noise in complex stroke regions. Based on theoretical validation of disentanglement effectiveness, we introduce a parameter-efficient fine-tuning strategy that updates only the style-related modules. This allows the model to better adapt to new styles while avoiding overfitting to the reference images' content. We further introduce the Grey and OCR metrics to evaluate the content quality of generated characters. Experimental results show that SLD-Font achieves significantly higher style fidelity while maintaining comparable content accuracy to existing state-of-the-art methods.
Jie Li, Suorong Yang, Jian Zhao +1
State Key Laboratory for Novel Software Technology, Nanjing University, China · School of Artificial Intelligence, Nanjing University, China · Department of Computer Science and Technology, Nanjing University, China +1
Few-shot font generation simultaneously requires global structural completeness and fine-grained local style fidelity. Existing methods usually either rely on global content-style modeling, which is robust but imperfectly disentangled, or emphasize component/local modeling, which captures fine details but relies heavily on local priors and reference coverage. We argue that the key challenge is not merely to learn purer conditions, but to organize complementary yet biased global and local conditions through multi-level allocation during generation. To this end, we propose SmartFont, a diffusion-based few-shot font generation framework that combines global content-style generation with weakly supervised local corrective experts. The local branch performs semantic-spatial allocation by learning expert-wise local concepts and semantically meaningful spatial maps under weak component supervision, enabling fine-grained correction without requiring explicit component-conditioned inference. On top of this, a denoising-state condition allocation module adaptively weights global content, global style, and local corrective feature across timesteps and injection blocks. Extensive experiments show that SmartFont achieves better global-local balance, improves glyph quality and local detail fidelity.