Abstract
Vector font synthesis is a challenging and ongoing problem in the fields of Computer Vision and Computer Graphics. The recently-proposed DeepVecFont achieved state-of-the-art performance by exploiting information of both the image and sequence modalities of vector fonts. However, it has limited capability for handling long sequence data and heavily relies on an image-guided outline refinement post-processing. Thus, vector glyphs synthesized by DeepVecFont still often contain some distortions and artifacts and cannot rival human-designed results. To address the above problems, this paper proposes an enhanced version of DeepVecFont mainly by making the following three novel technical contributions. First, we adopt Transformers instead of RNNs to process sequential data and design a relaxation representation for vector outlines, markedly improving the model's capability and stability of synthesizing long and complex outlines. Second, we propose to sample auxiliary points in addition to control points to precisely align the generated and target Bézier curves or lines. Finally, to alleviate error accumulation in the sequential generation process, we develop a context-based self-refinement module based on another Transformer-based decoder to remove artifacts in the initially synthesized glyphs. Both qualitative and quantitative results demonstrate that the proposed method effectively resolves those intrinsic problems of the original DeepVecFont and outperforms existing approaches in generating English and Chinese vector fonts with complicated structures and diverse styles.
Introduction
Vector fonts (like SVGs) are the gold standard for typography because they are scale-invariant and mathematically precise. However, generating them automatically is incredibly difficult. Previous models, including the original DeepVecFont, relied on Recurrent Neural Networks (RNNs) to predict the sequence of drawing commands. RNNs struggle with long-range dependencies—essentially "forgetting" the beginning of a complex character by the time they reach the end. This leads to "location shift" (where the outline doesn't close properly) and structural artifacts. Furthermore, previous refinement techniques often relied on matching vector outlines to raster images, which frequently resulted in "over-smoothed" corners or "under-smoothed" connections, making the fonts look "mushy" or amateurish.
Methodology
DeepVecFont-v2 introduces several novel architectural changes to move beyond these limitations:
- Transformer-based Architecture: Unlike RNNs, Transformers use self-attention to look at all parts of a sequence simultaneously. This allows the model to maintain structural consistency even in very long sequences of drawing commands.
- Relaxation Representation: Standard SVG notation is "compact"—the start point of a new command is implicitly the end point of the previous one. The authors "relax" this by explicitly defining start and end points for every command and then using a specific loss function ($L_{cons}$) to force these points to merge during training, making the data structure more compatible with Transformer attention mechanisms.
- Bézier Curve Alignment Loss: Instead of just comparing the "control points" of a curve (which can be mathematically different but visually similar), the model samples auxiliary points along the actual curve. This ensures the generated shape precisely matches the target geometry.
- Context-based Self-Refinement: The model includes a second, two-layer Transformer decoder. This module takes the initial output and performs a "second pass," using the global context of the glyph to remove artifacts and fix local distortions.
Experiments and Results
The researchers evaluated their model on two primary datasets: an English font set (9,460 fonts) and a more challenging Chinese font set (246 fonts). DeepVecFont-v2 achieved lower reconstruction errors than both DeepSVG and the original DeepVecFont, reducing error on the English dataset from 0.056 to 0.052.
Visually, the results are much sharper. The model successfully avoids the "location shift" and the "mushy" corners seen in previous state-of-the-art methods. It handles Chinese characters with multiple closed paths and complex intersections much better than previous methods, which often produced fragmented or "melted" results. Furthermore, the model can smoothly "morph" one font style into another by interpolating in the latent space, producing believable intermediate font weights and styles.
Conclusion
Despite the improvements, the model still hits a ceiling with extreme complexity. For very dense Chinese characters, the drawing paths become so long that the model can still fail to synthesize them correctly, likely due to the inherent uncertainty in how humans design complex fonts. Future work will focus on even more robust SVG embeddings and finding ways to handle the massive topological variety found in the full set of thousands of Chinese characters.
Summary updated