Skip to content
BENIBIX Learn

Variable Fonts and OpenType

Level 3 · Setting text

The hidden extras inside a modern font. Features you switch on by a code, true small raised numbers, and fonts that hold every weight in one file.

Course contentsLesson 13 of 17

After this lesson you can

  • Switch on a hidden font feature
  • Set superscripts the right way
  • Explain what a variable font saves

11 mincovers 3 glossary entries

Worth reading first: Uppercase and Title Case

What OpenType features and variable fonts do

Most fonts today are OpenType font files, a format made by two big software firms in 1996. A font in it can hold extra glyphs that stay hidden until you switch them on. Each extra has a four letter code. liga turns on ligatures, smcp gives small caps and tnum makes all numbers the same width.

Those codes solve real problems. In a price table, normal numbers have different widths, so columns wobble. tnum lines every digit up. onum gives old-style numbers that dip below the line and blend into body text. Most design apps show these as options in a type panel.

Superscript and subscript are small text set a bit above or below the line. The 2 in x² is a superscript. The 2 in H₂O is a subscript. Footnote marks and the th in 5th are superscripts too. A good font draws them as their own glyphs, through an OpenType feature.

A fake superscript is just a normal number shrunk and raised. Like fake small caps, it comes out thin and pale, and it can push the line apart. If a font has real ones, use them. On the web, the sups feature turns them on.

A variable font is one font file with sliders built in. Instead of a file for each weight, one file holds the whole range. On the web you can set the weight to any number from 100 to 900, not just the steps the family came with. Variable fonts arrived in 2016.

The main win is speed. A page that loads four weights loads four files. A variable font loads one, often smaller than the four together. It also lets a design pick a weight of 450 or 550 when 400 looks too light and 500 too heavy.

People often assume every font has every feature. Most do not. A cheap or free font may have no small caps, no tnum and only two weights. Check what a font holds before you pick it for a job that needs those extras.

css
.price-table { font-feature-settings: "tnum" 1; }
.footnote-mark { font-variant-position: super; }
h1 { font-family: "Inter", sans-serif; font-weight: 650; }
Line up the numbers in a table. Use real raised numbers. Pick a weight between the usual steps.
One file, one slider. Any weight from 100 to 900 comes out of the same variable font.

Worked example

A price list that stopped wobbling

Rosa's shop listed prices like 11.10 and 98.45 in a column. The 1s were narrower than the 8s, so the decimal points did not line up.

She switched on tnum in her font. Every digit took the same width, and the whole column of 40 prices lined up.

The words for this lesson3

Check yourself

What is the main advantage of a variable font on a website?

Finished this lesson?

Marking it complete also marks its 3 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.