# Patch-Font: Enhancing Few-Shot Font Generation with Patch-Based Attention and Multitask Encoding
## 1 Introduction  
Font design is essential in many scenarios, including logo designs, branding, multilingual typography, handwriting imitation, augmented reality (AR), virtual reality (VR) overlays, and assistive technologies. However, creating a complete font for scripts with large character sets (e.g., Korean, Chinese) can be highly labor-intensive and costly, requiring designers to manually craft each glyph. Typically, the designer starts with a few hundred Chinese or Korean characters that have the most components, and the rest of the components can be mixed and created by mixing and combining based on the target characters. It still remains a time-consuming and labor-intensive task. Due to the high production costs of fonts for these languages, numerous automatic few-shot font generation (FFG) methods [1, 2, 3, 4, 5, 6, 7, 8] have been presented recently due to advancements in deep learning techniques. These models have been developed by utilizing Convolutional Neural Networks (CNNs) [9, 10, 11], Generative Adversarial Networks (GANs) [12, 13, 14], image-to-image (I2I) [15, 16, 17, 18, 19] and Transformers [20, 21]. By using only a few characters as sample images, these FFGs aim to generate entire fonts with the same style as sample images. The conventional FFG approach adheres to the paradigm of disentangling and combining style andcontent images. It can either utilize a global representation of style or a component-wise representation of style. In font styles, a global representation may encompass principal characteristics such as font weight, family type, and size attributes that define the font's general appearance. For example, in image style transfer, the conventional approach may use a global representation of style by directly matching the statistics of the entire image, such as mean and covariance. On the other hand, the component-wise approach, which focuses on local styles, decomposes each reference sample that shares the same font into predefined components and radicals. This method allows for more fine-grained control over the style elements, as each component (like stroke thickness, serif details, or curvature of letterforms) can be adjusted individually. However, it requires a prior knowledge of the components and radicals, which may limit its applicability to specific domains or styles. Additionally, each character must be manually associated with a particular set of components, necessitating more preparation when applying for new scripts. Furthermore, in some recent works, VQ-Font [3], XMP-Font [22], and FS-Font [23] attention mechanisms have been used to focus on the local style of the font images. [PERSON] et al. [23] proposed a cross-attention method to aggregate the reference styles into a fine-grained representation. XMP-Font [22] created a self-supervised cross-modality pre-training method and a cross-modality transformer network that models how styles are shown at the character, stroke, and component levels. Although the component-based attention approach of FS-FONT [23] and cross-modality pre-training of XMP-FONT [22] significantly improve the generation results, their reliance on manually predefining components limits their ability. Building upon these ideas, VQ-Font [3] introduces a novel method that leverages both global and local style elements without the need for predefining components. [PERSON] et al. [3] proposed a cross-attention-based style transfer module and self-learned discrete latent codes through vector quantization that effectively transfer styles of reference glyphs to the components without manual component definition. Their overall approach aims to control both the global glyph characteristics and the component-level style representations. Although it is innovative in its approach to combining global and local style elements, it is not without its limitations. It follows a two-stage training process, which makes its training process more time-consuming, and complex compared to single-stage training methods.