Automatic few-shot font generation (AFFG), aiming at generating new fonts with only a few glyph references, reduces the labor cost of manually designing fonts. However, the traditional AFFG paradigm of style-content disentanglement cannot capture the diverse local details of different fonts. So, many component-based approaches are proposed to tackle this problem. The issue with component-based approaches is that they usually require special pre-defined glyph components, e.g., strokes and radicals, which is infeasible for AFFG of different languages. In this paper, we present a novel font generation approach by aggregating styles from character similarity-guided global features and stylized component-level representations. We calculate the similarity scores of the target character and the referenced samples by measuring the distance along the corresponding channels from the content features, and assigning them as the weights for aggregating the global style features. To better capture the local styles, a cross-attention-based style transfer module is adopted to transfer the styles of reference glyphs to the components, where the components are self-learned discrete latent codes through vector quantization without manual definition. With these designs, our AFFG method could obtain a complete set of component-level style representations, and also control the global glyph characteristics. The experimental results reflect the effectiveness and generalization of the proposed method on different linguistic scripts, and also show its superiority when compared with other state-of-the-art methods. The source code can be found at https://github.com/awei669/VQ-Font.
翻译:自动小样本字体生成(AFFG)旨在仅通过少量字形参考即可生成新字体,从而降低人工设计字体的劳动成本。然而,传统AFFG范式中的风格-内容解耦方法无法捕捉不同字体的多样化局部细节。为此,研究者提出了多种基于组件的方案来解决该问题。基于组件的方法通常需要预先定义特殊字形组件(如笔画和偏旁部首),这对不同语言的AFFG任务而言并不可行。本文提出了一种新颖的字体生成方法,通过聚合字符相似度引导的全局特征与风格化组件级表征来实现。我们通过测量内容特征对应通道间的距离来计算目标字符与参考样本的相似度得分,将其作为聚合全局风格特征的权重。为更好地捕捉局部风格,我们采用基于交叉注意力的风格迁移模块,将参考字形的风格迁移至组件上,这些组件是通过向量量化自学习的离散潜在编码,无需人工定义。基于上述设计,我们的AFFG方法能够获取完整的组件级风格表征,同时控制全局字形特征。实验结果证明了该方法在不同语言文本上的有效性和泛化能力,并在与当前最优方法的对比中展现了优越性。源代码见:https://github.com/awei669/VQ-Font。