Differentiable variable fonts

Kinjal Parikh, Danny M. Kaufman, David I. W. Levin, Alec Jacobson

TL;DR

Researchers have developed a way to make variable fonts—fonts with adjustable axes like weight or slant—fully differentiable. By mapping font parameters to vector geometry in a way that supports gradient-based optimization, they enable powerful new workflows like "dragging" font shapes directly, physics-based text animation, and automatic font matching, all while guaranteeing the text remains legible and stylistically consistent.

What Problem Does This Paper Address?

In digital design, there is a frustrating "one-way street" between typography and geometry. If you want to precisely manipulate the shape of a letter, you usually have to convert it into raw vector paths (outlines). Once you do this, you lose the "font-ness" of the object: you can no longer easily change its weight, and it’s easy to accidentally destroy the legibility or stylistic harmony intended by the type designer.

Variable fonts (the OpenType standard) were meant to solve this by providing "axes" (sliders) for weight, width, etc. However, these are often unintuitive. If a font has 10 different axes, finding the right combination to fit a specific shape is a nightmare for an artist. There was no mathematical bridge that allowed a computer to say, "To make this serif touch that line, move the 'weight' slider by 0.2 and the 'slant' slider by 0.1."

Methods

The authors distilled the complex, often "implementation-skewed" OpenType specification into a compact, differentiable mathematical formulation.

  1. Mathematical Modeling: They modeled how glyph shapes are constructed from a "default" outline plus "delta sets" (displacement vectors). These deltas are scaled by "support functions"—piecewise-linear weights that determine which parts of the design space are active.
  2. Differentiable Pipeline: They implemented this logic in PyTorch. This allows them to calculate gradients of the glyph's final 2D positions with respect to the input axis parameters.
  3. Energy Minimization: With gradients available, they can define "energies" (loss functions). For example, a "direct manipulation" energy minimizes the distance between a point on a letter and a user's cursor. By minimizing this energy, the system automatically finds the axis values that best satisfy the user's "drag" intent.
  4. Differentiable Rasterization: By plugging their framework into a differentiable SVG rasterizer, they can even optimize font parameters to match a target pixel image (raster-to-variable-font matching).

Datasets

This paper does not use a traditional training dataset, as it is an optimization framework rather than a deep learning model. Instead, it evaluates the method using a diverse set of professional variable fonts, including:

  • Recursive, Afacad Flux, Amstelvar, and Graduate (for general manipulation and layout).
  • Angst and Noto Sans Simplified Chinese (to demonstrate cross-language and stylistic consistency).
  • Kamino, DynaPuff, and Movement (for physics-based animations).
  • Shantell Sans (for overlap-aware modeling).

Key Insights and Ideas

  • The "Design Space" as a Safety Rail: The core "aha" moment is treating the variable font's parameter space as a constrained manifold. By optimizing within this space, you can't "break" the font. Any result the optimizer finds is, by definition, a valid design produced by the original type designer.
  • Inverse Kinematics for Fonts: They essentially created an "IK" system for typography. Just as an animator drags a character's hand and the arm joints follow, a designer can drag a serif and the font's weight and width axes follow.
  • Physics-as-Optimization: By making the font differentiable, they can treat font axes as physical degrees of freedom. You can "drop" a word into a container, and the letters will squash and stretch to fit the space based on physical forces, all while remaining perfectly rendered vector type.

Key Results

  • Usability: In a pilot user study, the "direct manipulation" interface (dragging points) received a System Usability Scale (SUS) score of 74.17, significantly higher than the 55.41 scored by traditional axis sliders.
  • Performance: The system is fast enough for interactive use. Update calls for direct manipulation take between 24ms and 49ms on a standard MacBook Pro (M1 Pro).
  • Font Matching: The system can successfully recover the exact parameters of a variable font from a target image and can even find the "closest" variable font instance to match a completely unrelated static font (like matching Amstelvar to a target of Didot).
  • Robustness: The framework handles complex typographic features like "overlap-aware modeling," where letters automatically adjust their shapes to avoid colliding with background objects or each other.

Limitations and Future Work

  • Discrete Changes: Some variable fonts use "bracket layers" to swap out entire glyph shapes at certain thresholds (e.g., a dollar sign losing its vertical bar at very small weights). These discrete jumps are not currently differentiable and cause "pops" in the optimization.
  • Authoring Burden: The method relies on high-quality variable fonts. Creating these is still a labor-intensive manual process for type designers. The authors suggest that "inverting" their framework could eventually help designers create variable fonts more easily.
  • Navigation: While the tool helps you find a specific point in the design space, it doesn't necessarily help you "explore" the creative possibilities of a font with dozens of axes. Future work could involve better optimization-based navigation tools.

Summary updated

BibTeX
@article{parikh2026differentiable,
  author = {Kinjal Parikh and Danny M. Kaufman and David I. W. Levin and Alec Jacobson},
  title = {{Differentiable variable fonts}},
  journal = {Computer Graphics Forum},
  year = {2026},
  doi = {10.1111/cgf.70415},
}
Figure