CSS Master Code Examples: Chapter 4

Using variable fonts

A basic, self-contained example that uses higher-level variable font-related properties.

This example uses Amstelvar, a a parametric variable font by David Berlow. This particular example is a simple one, but perhaps a little profound.

Unlike the basic example, which uses a separate file for each variation in font weight or style, this example uses one file for every weight.

Notice that variable fonts mean that we are no longer locked into font-weight increments of 100. We can use any value that falls within the range that the font file supports.

Amstelvar does still require a separate file for italicized text. That's a limitation of Amstelvar, not of variable fonts.

Related specification: CSS Fonts Module Level 4