Papers
Topics
Authors
Recent
Search
2000 character limit reached

VecFontSDF: SDF-Based Vector Font Reconstruction

Updated 9 April 2026
  • VecFontSDF is an end-to-end framework that models glyphs with signed distance functions and implicit shape representations to produce high-quality vector fonts.
  • The method uses parabolic primitive pseudo-distance functions and a conversion to quadratic Bézier curves, ensuring compatibility with formats like SVG and TTF.
  • Empirical evaluations demonstrate that VecFontSDF outperforms prior methods in reconstruction accuracy, interpolation, and few-shot vector font synthesis.

VecFontSDF is an end-to-end trainable framework for reconstructing and synthesizing high-quality vector fonts using signed distance functions (SDFs) and SDF-based implicit shape representations. Unlike prior works focused predominantly on raster image font generation, VecFontSDF learns to model each glyph as a composition of shape primitives enclosed by parabolic curves that are amenable to analytical conversion into quadratic Bézier curves. This capability yields outputs directly compatible with prevalent vector font formats such as SVG and TTF, facilitating direct application in digital content and printing workflows. Extensive qualitative and quantitative evaluations demonstrate that VecFontSDF substantially surpasses previous methods in vector font reconstruction, interpolation, and few-shot vector font synthesis tasks (Xia et al., 2023).

1. Implicit Signed Distance Function Representation

Glyphs in VecFontSDF are represented as a collection of closed contours, each composed of quadratic Bézier curves parameterized as

B(t)=(1t)2P0+2t(1t)P1+t2P2,0t1,B(t) = (1-t)^2 P_0 + 2t(1-t)P_1 + t^2 P_2, \quad 0 \leq t \leq 1,

where P0P_0 and P2P_2 are on-curve endpoints and P1P_1 the off-curve control point. For supervision, the method generates a target SDF D(x,y)D(x, y) for each glyph by computing the distance from a point to its nearest Bézier segment. This process involves solving for the parameter t^=argmint(x(t),y(t))(x,y)2\hat t = \arg\min_t \|(x(t), y(t)) - (x, y)\|^2 and then computing the signed distance using the direction of the Bézier derivative. Target SDFs are generated both on the uniform image grid ("grid SDF") and by dense sampling near glyph contours ("contour SDF").

2. Parabolic Primitive Pseudo-Distance Functions

Practical end-to-end learning precludes direct backpropagation through the analytic SDF computation. To circumvent this, VecFontSDF approximates glyphs as the intersection of NpN_p shape primitives. Each primitive is defined as the union of NaN_a implicit parabolic arcs parameterized as

k(px+qy)2+dx+ey+f=0,p2+q2=1,k (p x + q y)^2 + d x + e y + f = 0, \qquad p^2 + q^2 = 1,

with the pseudo-distance to an arc jj in primitive P0P_00 given by

P0P_01

The primitive’s signed distance is P0P_02, and the overall glyph SDF is P0P_03, so that P0P_04 indicates point inclusion in the glyph region. This formulation enables differentiable training while allowing the model to recover meaningful, compact vector outlines.

3. Conversion to Quadratic Bézier Curves

At inference, each implicit parabolic arc is analytically converted to a quadratic Bézier segment to ensure compatibility with standard font engines. The process identifies intersection points of the arc with the primitive boundary, assigns them to P0P_05 and P0P_06, then sets the control point P0P_07 via a closed formula involving the primitive parameters. The full glyph outline is produced by repeating this conversion across all parabolic primitives and merging the resulting segments into closed contours. This direct conversion distinguishes VecFontSDF from earlier SDF approaches that do not yield Bézier-compatible outputs or require thousands of control points.

4. Network Architecture and Training Objectives

VecFontSDF's architecture comprises a ResNet-18 encoder (LeakyReLU, BatchNorm) that maps an input P0P_08 glyph image P0P_09 to a 512-dimensional feature vector P2P_20. The SDF decoder consists of two fully connected layers and a ReLU nonlinearity, predicting the parameters P2P_21 with P2P_22 and P2P_23. The pseudo-SDF module evaluates P2P_24 over the image domain.

A differentiable renderer applies a smooth step function to P2P_25 to produce a reconstructed raster image, parameterized by a learnable threshold P2P_26. Training optimizes a total loss,

P2P_27

where P2P_28 is raster image reconstruction, P2P_29 and P1P_10 enforce SDF consistency, and P1P_11 regularizes parameter constraints such as P1P_12 and minimum P1P_13. The loss weights are fixed as P1P_14 and P1P_15.

5. Empirical Evaluation and Comparison

Experiments utilize 1,116 publicly available fonts (O’Donovan et al.), with P1P_16 train/test split and glyphs rasterized at P1P_17 resolution. Evaluation metrics include P1P_18 pixel error, IoU, PSNR, LPIPS, and SSIM. VecFontSDF achieves P1P_19, IoU D(x,y)D(x, y)0, PSNR D(x,y)D(x, y)1 dB, LPIPS D(x,y)D(x, y)2, and SSIM D(x,y)D(x, y)3, markedly outperforming prior SDF baselines BSP-Net and IGSR, which obtain D(x,y)D(x, y)4 and IoU D(x,y)D(x, y)5. Ablation studies reveal that removing grid/contour SDF losses significantly degrades reconstruction accuracy.

The method supports linear interpolation in the latent D(x,y)D(x, y)6-space, enabling smooth morphing between font styles and the synthesis of novel vector glyphs. In few-shot font style transfer, a dual-encoder (for style and content) and UNet decoder first predict an intermediate glyph image, which VecFontSDF then reconstructs as an SDF and Bézier outline. With only four style references in raster form, VecFontSDF surpasses DeepVecFont, which requires vector/raster modalities and offline refinement for similar tasks. The outlines produced are distortion-free and concise.

6. Qualitative Assessment and Limitations

VecFontSDF exhibits strong fidelity in reproducing serifs, concave loops, and thin strokes, representing glyphs with tens rather than thousands of Bézier segments. Prior SDF-based methods—BSP-Net, IGSR, Im2Vec, and multi-implicits—are limited in this regard, resulting in jagged edges, rounded corners, or exceedingly large numbers of control points and lacking direct compatibility with quadratic Bézier-based font specifications. However, for highly irregular or heavily disconnected cursive shapes (e.g., G, S, cursive f, N), the fixed number of primitives can become a limiting factor, thereby reducing reconstruction accuracy for such glyphs.

7. Future Directions

Ongoing research directions highlighted include incorporating richer network backbones, adopting adaptive or dynamic numbers of parabolic primitives per glyph, and extending pseudo-distance functions to more expressive higher-order curves such as cubics. These enhancements aim to further improve generalization, reconstruction capacity for complex scripts, and applicability to broader classes of vector graphics (Xia et al., 2023).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to VecFontSDF.