OpenType Features Support in Conversion
Understand how GSUB and GPOS OpenType features survive format conversion and how to enable them in CSS for web typography.
Key Takeaways
- • GSUB handles glyph substitutions (ligatures, small caps, alternates)
- • GPOS handles glyph positioning (kerning, mark placement)
- • All OpenType features preserve during WOFF/WOFF2 conversion
- • Subsetting can break features if required glyphs are removed
In this article
OpenType features extend typography beyond basic character rendering. They enable ligatures that join letters elegantly, small caps for sophisticated headings, stylistic alternates for visual variety, and precise positioning for complex scripts. Understanding these features helps you preserve and utilize them in web fonts.
The good news: OpenType features are stored in tables that survive format conversion intact. The challenge is knowing what features exist in your font, how to preserve them during subsetting, and how to activate them in CSS.
GSUB: Glyph Substitution
The GSUB table handles features that replace one glyph (or sequence) with another. When you type "fi" and it becomes a single ligature character, that's GSUB at work.
GSUB Lookup Types
GSUB defines 8 lookup types, each handling a different substitution pattern. Understanding lookup types helps when debugging features that fail to activate or when inspecting font binaries with tools like fontTools:
Single Substitution
One glyph → one different glyph. Used for smcp (lowercase → small cap), sups (numeral → superscript), and similar one-to-one replacements.
Multiple Substitution
One glyph → sequence of glyphs. Used to decompose ligatures during processing, or for scripts where one character maps to multiple glyphs.
Ligature Substitution
Sequence of glyphs → single glyph. The liga feature (fi → fi-ligature) uses Type 4. Lookup searches for the longest matching sequence first.
Chained Context Substitution
Substitution based on surrounding glyphs (lookbehind + lookahead). Used by calt for contextual alternates that change based on neighboring letters.
Common GSUB Features
ligaStandard Ligaturesfi, fl, ff, ffi, ffl → single glyphs. On by default.
dligDiscretionary Ligaturesct, st, sp → decorative joins. Off by default.
smcpSmall CapsLowercase → small capital forms.
c2scCaps to Small CapsUppercase → small capital forms.
saltStylistic AlternatesAlternative glyph designs for any character.
ss01-ss20Stylistic SetsNamed collections of coordinated alternates.
caltContextual AlternatesSubstitutions based on surrounding characters.
swshSwashesDecorative flourishes on capitals and terminals.
GSUB lookups are applied in a specific order determined by the font's feature definitions and the text engine's lookup ordering rules. When shaping text, the engine applies required features first (like ccmp for precomposed glyph sequences), then default-on features (calt, liga, kern), and finally user-activated features (smcp, dlig, ss01). The order matters because substitutions are cumulative: a calt feature that replaces a standard "g" with an alternate form changes the glyph ID in the sequence, and any subsequent smcp lookup must reference the alternate g's small-cap variant—not the standard g small-cap—to produce the correct result. Fonts that define stylistic alternates for every feature combination require more GSUB rules but produce more predictable results when features are combined.
Script and language tags in GSUB determine which lookups are active for specific writing systems. The GSUB table organizes features under a ScriptList and LanguageSystem hierarchy, allowing different feature behavior per language. A font might enable different ligature sets for Turkish (which requires special handling of dotted and dotless i to avoid ambiguity) versus standard Latin. The OpenType Feature Registry maintained by Microsoft defines registered four-letter feature tags with standardized semantics—liga, smcp, kern—while fonts can also define unregistered proprietary tags for custom behavior that foundries must document separately.
GPOS: Glyph Positioning
The GPOS table handles features that adjust glyph positions without replacing them. Kerning is the most common example, but GPOS also handles accent placement and complex script positioning.
GPOS Lookup Types
Single Adjustment
Adjust position of individual glyphs (rare in Latin fonts)
Pair Adjustment (kern)
Kerning between glyph pairs—the most common GPOS usage
Mark-to-Base (mark)
Position combining marks (accents) on base characters
Mark-to-Mark (mkmk)
Position marks relative to other marks (stacked diacritics)
GPOS vs Legacy kern Table
OpenType fonts can store kerning in two locations: the legacy kern table (Format 0) and the modern GPOS Lookup Type 2. Most current fonts include GPOS pair adjustments for full coverage, with some retaining the kern table for compatibility with legacy software that doesn't read GPOS. The key difference is that GPOS supports class-based kerning — instead of defining A→V, A→W, A→Y, A→T as four separate pairs, a single class definition groups similar right-side characters and one kern value covers all four combinations. This can reduce kerning data size by 80–90% for fonts with extensive accented character coverage.
Enabling Features in CSS
/* Modern approach: font-variant properties */
.typography {
/* Ligatures */
font-variant-ligatures: common-ligatures;
font-variant-ligatures: discretionary-ligatures;
/* Caps */
font-variant-caps: small-caps;
font-variant-caps: all-small-caps;
/* Numbers */
font-variant-numeric: oldstyle-nums;
font-variant-numeric: tabular-nums;
}
/* Legacy/advanced: font-feature-settings */
.advanced {
font-feature-settings:
'liga' 1, /* Standard ligatures */
'dlig' 1, /* Discretionary ligatures */
'smcp' 1, /* Small caps */
'ss01' 1, /* Stylistic set 1 */
'kern' 1; /* Kerning */
}
/* Feature reference by tag */
.specific {
font-feature-settings: 'salt' 1; /* All alternates */
font-feature-settings: 'cv01' 1; /* Character variant 1 */
}CSS Property Preference
Use font-variant-* properties when possible—they're more readable and cascade properly. Use font-feature-settings only for features without a dedicated property (like stylistic sets ss01-ss20) or for fine-grained control.
Browser Support for OpenType Features
Browser support for activating OpenType features via CSS is now comprehensive across modern browsers:
| CSS Property | Chrome | Firefox | Safari | Notes |
|---|---|---|---|---|
| font-feature-settings | 16+ | 4+ | 9.1+ | Universal support; use for ss01-ss20, cv01-cv99 |
| font-variant-ligatures | 34+ | 34+ | 9.1+ | Preferred for liga, dlig, clig |
| font-variant-caps | 52+ | 34+ | 9.1+ | Activates smcp, c2sc, petite-caps |
| font-variant-numeric | 52+ | 34+ | 9.1+ | Controls onum, tnum, frac, sups, sinf |
Enabling a feature in CSS does not guarantee it works — the font must contain that feature in its GSUB/GPOS tables. Use browser DevTools (Font tab in Chrome) or Wakamai Fondue to inspect which features a loaded font actually supports before writing CSS to activate them.
Feature Preservation in Conversion
OpenType features are stored in GSUB and GPOS tables, which are preserved during TTF, OTF, WOFF, and WOFF2 conversion. The tables are compressed but not modified.
Subsetting Considerations
Subsetting can break OpenType features if not done carefully:
# Preserve all layout features when subsetting pyftsubset font.ttf \ --unicodes="U+0000-00FF" \ --layout-features='*' \ # Keep all GSUB/GPOS features --output-file=font-subset.ttf # Or preserve specific features pyftsubset font.ttf \ --unicodes="U+0000-00FF" \ --layout-features='kern,liga,smcp' \ --output-file=font-subset.ttf
Without --layout-features, subsetting may remove feature tables. Even with it, if you remove a glyph that a feature references (like the 'fi' ligature glyph), that feature breaks for those characters.
Discovering what features a font supports before writing CSS to activate them is straightforward with modern inspection tools. Wakamai Fondue (wakamaifondue.com) accepts a dropped font file and lists every OpenType feature, showing sample text demonstrating each feature's effect and generating the CSS needed to activate it. The Chrome DevTools Font panel—accessible via Elements → Computed → Rendered Fonts—shows which font is rendering text on any element and indicates which features are active. For programmatic inspection, fontTools provides complete feature access: iterating over font['GSUB'].table.FeatureList.FeatureRecord returns all available feature tags with their associated lookup indices. This inspection step prevents writing CSS for features the font does not actually contain.
Feature preservation during conversion is reliable for WOFF and WOFF2 conversions because those formats are compression wrappers that do not modify table content. The GSUB and GPOS tables pass through intact. The risk arises specifically during subsetting: pyftsubset defaults to removing all OpenType layout features unless given explicit instructions to keep them. For a Latin-only subset, --layout-features='kern,liga,calt' preserves the most commonly activated features while discarding script-specific tables irrelevant to the subset. Feature loss during subsetting is silent—the subset font loads and renders correctly, but the CSS feature activation that worked with the full font has no visible effect, and the missing functionality may not be noticed until users report unexpected text appearance in premium typographic contexts.
Convert with Features Intact
Our converter preserves all OpenType features during format conversion.
Try Font ConverterWritten by
Sarah Mitchell
Product Designer, Font Specialist
Verified by
Marcus Rodriguez
Lead Developer
OpenType Features FAQs
Common questions about GSUB, GPOS, and feature preservation
