Design glossaryOpenType is a font file format from Microsoft and Adobe that works on all major systems and supports large character sets and features such as ligatures.
OpenType is the standard file format for digital fonts. Microsoft and Adobe developed it together in the 1990s as a successor to both TrueType and Adobe's PostScript Type 1 fonts, and it was later published as an ISO standard, the Open Font Format. An OpenType font is a single file that works on Windows, macOS, and Linux and in every modern browser. Earlier formats were often tied to one platform, and Type 1 fonts needed separate files for screen and printer.
OTF and TTF
OpenType fonts come with one of two kinds of letter outlines. Fonts with PostScript-style outlines usually use the .otf extension; fonts with TrueType outlines usually keep .ttf, even though they are OpenType too. For everyday use the difference rarely matters. Adobe apps have since dropped support for the old Type 1 format, so OpenType is effectively the only desktop format left.
What OpenType adds
- Large character sets. A single font can hold tens of thousands of glyphs, covering many languages and scripts through Unicode.
- Layout features. Fonts can include ligatures (such as fi and fl joined), small caps, old-style and tabular figures, fractions, contextual alternates, swashes, and stylistic sets, which the app or browser switches on as needed.
- Kerning. Spacing adjustments for awkward letter pairs are built into the font. See kerning.
- Variable fonts. Since 2016, one OpenType file can contain a whole range of weights, widths, or other styles along continuous axes, instead of a separate file for each.
OpenType on the web
Websites usually serve fonts as WOFF2, a compressed wrapper around OpenType or TrueType data that loads faster. The OpenType features inside still work, and CSS can turn them on:
font-variant-numeric: tabular-numsgives figures equal widths, so prices and tables line up.font-variant-ligaturesandfont-variant-capscontrol ligatures and small caps.font-feature-settings: "ss01"switches on a stylistic set, for fonts that offer them.font-variation-settings, or plainfont-weight, picks a point along a variable font's axes.
One variable font file can replace four or five static files, which often means fewer requests and less to download.
OpenType in WordPress
Block themes register fonts in theme.json, and the Font Library in the Site Editor lets site owners upload font files or install Google Fonts so they are served from the site itself. Classic themes load fonts with @font-face rules in their stylesheets.
Check the license
Owning a font file does not mean it can go on a website. Many commercial fonts sell desktop and web licenses separately, sometimes priced by page views. Open-source families, such as those under the SIL Open Font License, can generally be embedded freely; check the terms either way.
Source: Microsoft, OpenType specification.