Guide · 9 steps · ~40 min
OpenType features.
An OpenType feature is a 4-letter
rule that tells a text renderer to swap one glyph for another, or to
position glyphs differently, based on context. Patens infers features from your glyph names (the Adobe Glyph List
convention) instead of asking you to author a .fea file. Name a glyph f_i and you have a fi ligature in the liga feature; name one a.smcp and you have small caps. This guide covers the auto-detect rules,
the major features your font will probably ship, and Patens's live
HarfBuzz shaping preview.
The OpenType spec is large; this guide covers the ~10 features that 90% of fonts use. For everything else (chained contextual substitutions, position-specific decomposition), Patens supports a custom .fea file that merges with the auto-generated one.
- 1
What an OpenType feature is
An OpenType feature is a 4-letter rule that tells a text renderer to swap one glyph for another, or to position glyphs differently, based on context. The kerning feature (kern) substitutes the default sidebearing with a kerned value when specific pairs meet. The ligature feature (liga) substitutes f + i with the single fi glyph. The small-caps feature (smcp) substitutes lowercase letters with their uppercase forms scaled to lowercase height. Each feature is independent; renderers can toggle them via CSS.
There are ~150 registered OT feature tags, but most fonts use fewer than 10. The common ones: kern, liga, dlig, smcp, c2sc, ss01-ss20, salt, calt, onum, lnum, tnum.
- 2
Patens auto-detects from glyph names
Manually writing OpenType feature files (.fea) is precise but tedious. Patens reads your glyph names and infers the features. A glyph named "f_i" becomes a fi ligature in the liga feature. A glyph named "a.smcp" becomes the small-cap substitution for "a" in the smcp feature. A glyph named "a.ss01" becomes a stylistic-set-1 alternate. "one.onum" is the old-style figure for "1". The naming convention is the Adobe Glyph List for New Fonts (AGLFN); Patens uses it as the canonical lookup.
Name your glyphs as you draw them, in AGLFN style. The features fall out for free. Renaming a glyph after the fact works but means re-checking the feature table.
- 3
Ligatures (liga, dlig)
A ligature replaces two or more glyphs with one. The standard liga feature handles required ligatures — fi, fl, ffi, ffl, ff — that prevent the f's overhang from colliding with the next letter. The discretionary dlig feature handles optional decorative ligatures (st, ct, Th). Browsers and most editors apply liga by default; dlig usually requires an explicit opt-in (font-variant-ligatures: discretionary-ligatures in CSS).
Draw the ligature as a single glyph named f_i (underscore between the source glyph names). The fi shape should be one continuous design — not a literal placement of the f next to the i.
- 4
Small caps + alternates (smcp, c2sc, ss01-ss20)
Small caps (smcp) substitutes lowercase letters with custom-drawn uppercase forms scaled to x-height. c2sc (caps-to-smallcaps) substitutes existing uppercase letters with the same small-cap glyphs — useful for the SHOULTS in all caps. Stylistic sets ss01-ss20 are 20 numbered slots for stylistic alternates: a single-story "a" instead of double-story, a hooked vs straight "g", a Roman vs Italic 7. Each set can be named via the OpenType name table ("Single-story a", "Hooked g") and apps display the names in their UI.
Use one ss-slot per cohesive set of alternates. A font with 17 stylistic alternates split across ss01–ss17 is confusing; the same alternates grouped logically (ss01 single-story letters, ss02 short descenders, etc.) reads as a feature, not noise.
- 5
Figures (onum, lnum, tnum, pnum)
Four mutually exclusive figure styles: lining (lnum), default in most modern fonts — figures sit on the baseline and reach cap-height. Old-style (onum) — figures sit at x-height with descenders, used in body text to blend with lowercase. Tabular (tnum) — every figure has the same advance width, used in columns of numbers. Proportional (pnum) — figures have their natural width. A professional font ships all four combinations: tnum + lnum (default), tnum + onum, pnum + lnum, pnum + onum.
Patens audit code figures-non-tabular fires when a project has lining figures but no tabular variants. In data-heavy contexts (financial reports, tables), tabular figures are required, not optional.
- 6
Contextual alternates (calt)
Contextual alternates (calt) substitute a glyph based on its neighbors. The classic use case: in a script font, the "a" at the end of a word might want a flourish that the "a" inside a word doesn't. The rule says "substitute a with a.end when followed by a word boundary." Patens generates simple calt rules from your alternate naming (a.init / a.medi / a.fina); for complex contextual logic, an exported .fea file handles edge cases the auto-detector can't infer.
calt is on by default in most renderers. If you draw .init / .medi / .fina alternates, Patens turns them on for free.
- 7
The Features tab in Patens
Open /project/[id]/features. The page lists every feature Patens detected from your glyph names — kern (auto from your kerning panel), liga (auto from f_i / f_f / f_l names), smcp (auto from .smcp glyphs), and any ss01-ss20 sets. Each feature can be toggled on / off, has an editable name, and shows a preview rendering through HarfBuzz.js — the same shaping engine browsers use. What you see in the preview is what shipped fonts will produce.
Audit code feature-kern-disabled-with-pairs fires when you have kerning pairs but the kern feature is off. The opposite (kern on, no pairs) also flags so you don't ship an empty feature table.
- 8
Live shaping preview
The Preview tab runs HarfBuzz.js — the same C++ shaping library compiled to WebAssembly — over your font and any text you type. It applies your features in the correct order (kern is positioning, liga is substitution; substitutions happen first, then positioning), respects your contextual rules, and renders the output. There's no "the font might look different in a real app" — HarfBuzz IS the real app for Chrome, Firefox, and most modern renderers.
Cmd+Shift+P opens Preview. Type the strings your font will set. Toggle features on/off to see the effect immediately.
- 9
Exporting the feature table
On export, Patens compiles the auto-detected features into the standard OpenType feature file format (.fea), then opentype.js writes them into the GSUB and GPOS tables of the output font. The resulting .otf / .woff2 has every feature you saw in the Features tab — no manual .fea editing needed. For projects that need rules the auto-detector can't express (chained contextual substitutions, position-specific decomposition), you can author a custom .fea and Patens merges it with the auto-generated one.
Verify in the target environment after export. Browsers honor everything; some legacy apps (Word 2016 and earlier) only honor a subset.
Related
The audit-codes reference documents the OpenType-feature codes Patens emits. The kerning guide covers the kern feature specifically. And the variable-fonts guide explains how features behave across masters.
Patens is in private alpha. Request an invite →