Skip to content

About

FlowVecFont: Scalable Vector Font Generation via Latent Flow Matching

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

FlowVecFont

FlowVecFont: Scalable Vector Font Generation via Latent Flow Matching

Our main contributions are:

  • We propose FlowVecFont, which applies flow matching to fixed-length glyph latents learned by a Transformer VAE, decoupling flow computation from outline length.
  • We demonstrate generalization to unseen fonts and characters by conditioning on vector reference glyphs for both font style and character content.
  • Experiments on Google Fonts show that generation quality consistently improves with model scale across conditioning strategies. Our 800M model is competitive with the pretrained 27B VecGlypher on Latin glyphs.
  • We provide TorchFont, a machine learning library for vector fonts.

Requirements

  • Git
  • uv
  • NVIDIA RTX 6000 Ada or better ×1

Smaller models can also run on GPUs with less VRAM. For example, Tiny VAE and Base flow models have been tested on a GPU with 16 GB of VRAM.

Usage

Synchronize the Google Fonts submodule under third_party/google/fonts:

git submodule sync
git submodule update --init --checkout --force --depth 1
git submodule foreach 'git clean -fd'

Install the dependencies:

uv sync

Run experiments with Lightning CLI. Choose a model preset from tiny, small, base, large, or xlarge.

Lightning runs compile models with max-autotune by default. Use --model.compile_mode default for a shorter warm-up. If you encounter problems with compilation, rerun with --model.compile_model false to disable it.

uv run vae fit \
  --config configs/model/tiny.yaml
uv run flow-cls fit \
  --config configs/model/base.yaml \
  --model.vae_checkpoint lightning_logs/path/to/vae.ckpt
uv run flow-style-ref fit \
  --config configs/model/base.yaml \
  --model.vae_checkpoint lightning_logs/path/to/vae.ckpt
uv run flow-ref fit \
  --config configs/model/base.yaml \
  --model.vae_checkpoint lightning_logs/path/to/vae.ckpt

Evaluate trained models with test.

uv run vae test \
  --config lightning_logs/path/to/config.yaml \
  --ckpt_path lightning_logs/path/to/vae.ckpt
uv run flow-cls test \
  --config lightning_logs/path/to/config.yaml \
  --ckpt_path lightning_logs/path/to/flow-cls.ckpt
uv run flow-style-ref test \
  --config lightning_logs/path/to/config.yaml \
  --ckpt_path lightning_logs/path/to/flow-style-ref.ckpt
uv run flow-ref test \
  --config lightning_logs/path/to/config.yaml \
  --ckpt_path lightning_logs/path/to/flow-ref.ckpt

Related Work

Method Approach Font support Vector output Bitmap-free Pretraining-free
DeepSVG (2020) 🔴 VAE 🔴 Latin ✅ ✅ ✅
Aoki & Aizawa (2022) 🔴 Encoder-decoder 🔴 Chinese ✅ ✅ ✅
DeepVecFont-v2 (2023) 🔴 VAE 🔴 Latin, Chinese ✅ ❌ ❌ VGG-19 loss
DualVector (2023) 🔴 VAE 🔴 Latin ✅ ❌ ❌ LPIPS
DesigNet (2026) 🔴 VAE 🔴 Latin, Chinese ✅ ✅ ✅
SVGFusion (2024) 🟢 Latent diffusion ❌ ✅ ❌ ❌ DINOv2
VecFusion (2024) 🟢 Diffusion 🔴 Multiple ✅ ❌ ✅
Zhao et al. (2024) 🟢 Diffusion 🔴 Latin ✅ ❌ ✅
FontDiffuser (2024) 🟢 Diffusion 🟠 Chinese, Korean ❌ ❌ ❌ VGG-16 loss
FM-Font (2026) 🟢 Flow matching 🟠 Chinese ❌ ❌ ❌ DINOv2
OmniSVG (2025) 🔵 Multimodal LLM ❌ ✅ ❌ ❌ Qwen2.5-VL
VecGlypher (2026) 🔵 Multimodal LLM 🔴 Latin ✅ ❌ ❌ Gemma 3
VecFontLLM (2026) 🔵 Multimodal LLM 🟢 Chinese ✅ ❌ ❌ StarCoder-1B
FlowVecFont (ours) 🟢 Latent flow matching 🟢 Multiple ✅ ✅ ✅
  • Methods are grouped by model family and sorted by publication year within each group.
  • Approach: model family; 🔴 VAE or encoder-decoder, 🟢 diffusion or flow matching, 🔵 LLM.
  • Font support: number of distinct characters across training and evaluation; 🔴 fewer than 1K, 🟠 1K to 10K, 🟢 10K or more.
  • Bitmap-free: no bitmap input or supervision, excluding evaluation.
  • Pretraining-free: no external pretrained weights for training or generation, including loss networks; evaluation-only metrics are excluded.
  • Names beside crosses identify representative pretrained components, not an exhaustive list.

See also The State of AI Font Generation.

Experiments

Dataset

All models use the same codepoint dataset. Font faces and codepoints are independently split at random according to the following matrix.

The font-face-level split intentionally allows families to span splits, accommodating applications such as adding Bold to a family with only Regular. "Unseen font" therefore refers to an unseen face, not necessarily an unseen family. Family-level splitting is not a focus of this work.

Seen Character Unseen Character Font split
Seen Font sfsc sfuc 95%
Unseen Font ufsc ufuc 5%
Character split 95% 5%

The SFSC group is then randomly split as follows.

Purpose Split Percentage
Training train 98%
Validation val 1%
Test sfsc 1%

The following table flattens the partition hierarchy into six splits and shows their approximate theoretical percentages. Actual proportions vary with font coverage and reference eligibility.

Split Font Character Purpose Percentage
train Seen Seen Training 88.45%
val Seen Seen Validation 0.90%
sfsc Seen Seen Test 0.90%
sfuc Seen Unseen Test 4.75%
ufsc Unseen Seen Test 4.75%
ufuc Unseen Unseen Test 0.25%

sfsc usually denotes the test split, but may refer to the full seen-font, seen-character group depending on context.

Tasks

We evaluate VAE reconstruction and font generation with three conditioning schemes using the dataset splits above.

Model Font style Character Train Validation Test
vae — — train val sfsc, sfuc, ufsc, ufuc
flow-cls ID ID train — sfsc
flow-style-ref References ID train — sfsc, ufsc
flow-ref References References train — sfsc, sfuc, ufsc, ufuc

For reference-conditioned generation, style references share the target font, and character references share the target character. The target itself is excluded; targets with insufficient references are omitted.

References come from train during training and from the pools below during testing.

Model Target split Style references Character references
flow-cls sfsc — —
flow-style-ref sfsc train —
flow-style-ref ufsc ufsc —
flow-ref sfsc train train
flow-ref sfuc train sfuc
flow-ref ufsc ufsc train
flow-ref ufuc ufsc sfuc

Citation

If you find this code useful in your research, please cite:

@misc{fujioka2026flowvecfont,
  title = {{FlowVecFont}: Scalable Vector Font Generation via Latent Flow Matching},
  author = {Takumu Fujioka and Gouhei Tanaka},
  year = {2026},
  eprint = {2611.32327},
  archivePrefix = {arXiv},
  primaryClass = {cs.CV},
  url = {https://arxiv.org/abs/2611.32327},
}

About

FlowVecFont: Scalable Vector Font Generation via Latent Flow Matching

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages