# Patch-Font: Enhancing Few-Shot Font Generation with Patch-Based Attention and Multitask Encoding
## 2 Related Works  
The field of few-shot font generation has made remarkable strides in recent years, marked by the introduction of several innovative methods designed to synthesize diverse font styles using a minimal set of reference glyphs. At the forefront of these advancements is DM-FONT [4], which only requires component labels for supervision. Central to DM-FontDM-FONT [4] is its utilization of a dual-memory architecture composed of persistent memory for capturing the overarching glyph structures and dynamic memory for detailing the local styles of components. Building on the advancements introduced by DM-Font [4], LF-Font [1], which pioneered localized style representations and character-wise style disentanglement, significantly improves the quality of generated font styles from a limited number of reference images, surpassing previous state-of-the-art methods. By effectively separating content and style representations, LF-Font has set a new benchmark for minimal reference and high-quality font generation.  
FS-Font [23] builds upon this by extracting fine-grained local styles from reference glyphs and learning the spatial correspondence between content and reference glyphs through a cross-attention mechanism. This innovation not only enhances high-fidelity font generation but also improves style consistency, marking a significant step forward in few-shot font generation for practical applications.  
MX-Font [2] introduced a novel concept of employing multiple localized experts to capture various local features, enabling the generation of different font styles from a few reference glyphs. The technique of using weak local component supervision facilitates the disentanglement of style and content, offering high-quality font images enriched with detailed local characteristics.  
XMP-Font [22] introduced an innovative approach to generating few-shot fonts by employing a cross-modality encoder that is pre-trained on an extensive font library dataset. This pre-training enabled the model to generate fonts by decoupling network processes, leading to superior performance compared to existing methods. In particular, XMP-Font [22] achieves higher success rates and better visual quality in generating both seen and unseen font styles. Despite its remarkable achievements, XMP-Font [22] encounters limitations in handling unseen stroke labels and languages with distinct stroke genres, suggesting areas for future improvement.  
Contrary to XMP-Font [22], VQ-Font [3] introduced a few-shot font generation method that utilizes a cross-attention-based style transfer module to achieve efficient font library creation without the need for component labels. The method adopts a Vector Quantization-based Variational Autoencoder (VQ-VAE) to automatically extract components and transfer local styles to all components via cross-attention in a single forward pass, making its content irrelevant. However, this approach relies on a codebook of discrete latent embeddings for local style representation and requires a two-stage training process, which adds complexity and computational overhead.  
While effective for modular scripts like Chinese and Latin, the fixed nature of the pre-trained codebook limits its ability to generalize to such structurally diverse scripts. In contrast, our proposed Patch-Font addresses these challenges by replacing the codebook-based approach with a patch-based attention mechanism that learns localized style features directly from glyph patches. By enabling single-stage training, Patch-Font reduces complexity while achieving superior generalizability across modular and compositional scripts.