An Intro to Variable Fonts

Presented at IndieWebCamp East 2020

What is a variable font?

Variable fonts expand—yet paradoxically simplify—the use of performant, advanced web typography!

Standard Font

When using static font files on your websites, you individually load each font style that you plan to use. This means if the font you’re using has three style variants (e.g. different weights), then you’ll need to load those three font files in order to use them. If you use many font styles, this could have a performance impact.


Work Sans
Light Weight (300)

Work Sans
Medium Weight (500)

Work Sans
Bold Weight (700)

Variable Font (One Font File)

In contrast, when you use variable font files on your websites, you only need to load a single font file, regardless of the number of styles it contains. This means the font you’re using could have anywhere from 3 to 1000 font variants, and you still only need a single font file. This can improve performance in some use cases.


Work Sans
Light, Medium & Bold Weights
(300, 500, 700)

There are five registered variable font axes in the OpenType Design-Variation Axis Tag Registry. They're based on common stylistic properties web developers and online typographers are likely to use most often.

Font Weight is a Registered Axis Variant

A

Thin Weight (100)

A

Light Weight (300)

A

Regular Weight (500)

A

Bold Weight (700)

A

Heavy Weight (900)

Although the semantics of each registered axis can be more easily understood via many of the other comprehensive guides to variable fonts out there, they’re each pretty straightforward. For example, we’ve already covered font weight.

You also may be familiar with font width if you’ve ever encountered condensed and extended versions of fonts. The italic font variant is ubiquitous, but the slant font variant might be new to you. Slant variants essentially rely on interpolated skewing of around 8º to 12º, as opposed to the italic glyphs that are usually specifically designed by typographers.

The number of custom axis variants a variable font can have is probably unlimited, but most variable fonts I’ve encountered stick to three to five.

Example of a Custom Axis Variant

A

CSTM Xprmntl 03
(Cyrillic Variant)

A

CSTM Xprmntl 03
(Medium Variant)

A

CSTM Xprmntl 03
(Blackletter Variant)

Beyond the five registered axis variants, variable fonts can also have an unlimited number of other custom axis variants. These custom variants need to be specified by the font author, but the sky’s the limit in terms of what those variants can encompass.

For example, the font above, called CSTM Xprmntl 03, is a work-in-progress font that currently has a single custom axis variant. It’s the result of the CSTM Fonts foundry asking themselves the following question, “What’s happens if we interpolate Blackletter typeface with Old Cyrillic Ustav?” The result is an extremely unique font that displays a lot of breadth despite only having a single axis variant!

What can you do with variable fonts?

Create smooth transitions using the 5 registered variable font axes.

There are 5 registered font axes in the OpenType Design-Variation Axis Tag Registry are weight, width, italic, slant, optical size.

Create unexpected effects and transitions with custom font axes.

The possibilities are infinite when it comes to custom axes in variable fonts. They can even be used to animate icons and imagery!

Add seamless font interactions and animations using CSS and/or JS

Beyond passive animations, variable fonts let you add complex forms of interactivity based on both simple and complex forms of input.

Easier font management for responsive websites

Variable fonts can improve website performance while consolidating the number of font files you have to load. This means you get smoother transitions with less loading time!

Where can you find variable fonts?

Google Fonts

A great resource for free fonts you can load on your website using Google Fonts' API.

V-Fonts.com

This directory lists both free and paid fonts, and makes it easy to test custom text.

Future Fonts

This unique website provides free and paid options for fonts that are works-in-progress.

Fontesk

A great resource for free fonts for both commercial and personal use.

Fonts Arena

A diverse collection of 17 variable fonts that are free for personal and commercial use.

FontSpace

A collection of 15 variable fonts that are available free of charge for personal use.

How can you learn more about variable fonts?

MDN Variable Fonts Guide

Can I Use | Variable Font Browser Support

OpenType Design-Variation Axis Tag Registry

Introduction to variable fonts on the web

About this project

I presented this project on November 14, 2020 as a keynote talk for IndieWebCamp East 2020. This project features three variable typefaces: CSTM Xprmnt l03 a paid font by CSTM Fonts, Space Grotesk a free font by Florian Karsten, and Work Sans a free font by Wei Huang.

Made by Outer Outer Space