Extension FontKit

Ops.Extension.FontKit.

Variable font rendering to cables.gl using fontkit.js 

This pipeline brings variable font rendering to cables.gl using fontkit.js, a JavaScript font parsing library. It extracts glyph outlines as SVG paths, enabling per-glyph animation of variable font axes (weight, width, optical size…), geometric transforms (rotation, scale, position), and multiline text layout — all feeding into a custom triangulation op for real-time WebGL rendering. The pipeline is designed around a chainable architecture: each op takes Glyph Paths + Glyph Positions arrays as input and outputs the same format, allowing arbitrary stacking of effects before final recombination.



Maintained by Team FontKit

FontParser

Loads a font file, parses it with fontkit.js, and lays out a text string into individual glyph outlines.

GlyphAxisMorph

Pre-calculates glyph outlines at axis min and max values, then interpolates coordinates arithmetically at render time — zero fontkit calls per frame.

GlyphCombine

Takes the per-glyph SVG paths and positions arrays and reconstructs a single combined SVG path string, ready for triangulation

GlyphTransformAnim

Applies geometric transformations per glyph via an array of values. Purely geometric — does not need the font, only Glyph Paths + Glyph Positions.