Kern is a typography explorer I built for variable fonts, with Next.js, TypeScript and Framer Motion. It has three views: a specimen sheet, a playground for moving the axes of a font and comparing two fonts, and a type scale generator that writes fluid clamp() values. This post covers the interface and the maths behind the generated scale.
The axes are data
Every font in Kern is a small config: a name, a CSS family and a list of axes, each with a tag, a label, a minimum, a maximum, a default and a step. Roboto Flex has weight, width, optical size, grade and slant. Fraunces adds softness and a wonky axis to weight and optical size. Playfair Display has weight only.
The slider panel never special-cases any of them. It maps over the list and renders a range input per axis, using that axis's own minimum, maximum and step. A font with one axis gets one slider, and a font with five gets five.…