Substitution Features

A substitution feature makes a glyph design reachable in a particular text context. Before writing its rules, decide what behavior you are offering, whether it is optional or required, and which scripts and languages should receive it.

Optional and Required Features

A feature can offer a choice, such as a swash or alternate figure style. It can also provide behavior necessary for readable text, such as joining forms, required ligatures, or composition and decomposition used by a script's shaping process.

These are different responsibilities. Optional features refine the presentation; required features enable readable text. In a complex script, joining forms, required ligatures, and composition or decomposition can be necessary for the text to read at all. They are not decorative improvements that the typesetter should have to discover. A required substitution belongs to the normal script process, as explained in Shaping Text.

For the designer, a feature is a named unit of behavior to provide. For the typesetter, an optional feature can appear as a choice such as small capitals or a stylistic set. Required features are different: the shaping engine applies the script's necessary processing rather than waiting for an unrelated style switch. The same interface may expose only some of the font's features, so the presence of a button is not the definition of a feature's importance.

Consider a stylistic alternate for a Latin letter. The ordinary letter remains legible when the alternate is unavailable; the choice changes the voice or appearance of the text. Now consider a connected script whose letters need contextual joining forms. Supplying only isolated drawings does not become adequate merely because those drawings are individually recognizable. The required relationships between forms must also be available.

This distinction affects what the feature promises. An optional set needs a coherent design purpose and a route by which a supporting application can select it. Required processing needs the glyphs and rules necessary for the intended writing system. Neither category is established by a suggestive glyph suffix alone. The following sections identify common feature families before the Features panel chapter explains their authoring environment.

“Default on” and “required” are not interchangeable. Standard ligatures are commonly enabled by default but remain different from required ligatures. Application controls and shaping-engine conventions determine how features are selected in a text run.

An unencoded glyph can serve as a substitution result even though typing a Unicode character does not map directly to it. Drawing a.ss01 therefore supplies the alternate shape, while a feature supplies the normal text route that selects it. Such glyphs can also be used in source construction or addressed directly for inspection; an unencoded drawing is not automatically a functioning text feature.

Common Feature Sets

Choose tags by their defined purpose rather than merely selecting an available four-character slot.

Purpose Tags and behavior
Ligatures liga: standard; dlig: discretionary; rlig: required; hlig: historical; clig: contextual ligatures.
Case-related forms smcp: lowercase to small caps; c2sc: capitals to small caps; case: forms or adjustments suited to capital text.
Figure height/style lnum: lining figures; onum: oldstyle figures.
Figure spacing pnum: proportional figures; tnum: tabular figures.
Alternate choices salt: stylistic alternates; aalt: access to alternates; ss01–ss20: stylistic sets.
Swashes and contextual forms swsh: swash forms; cswh: contextual swashes; calt: contextual alternates.
Fractions and small figures frac: fractions; ordn: ordinals; sups: superscripts; subs: subscripts; sinf: scientific inferiors.
Localized forms locl: forms appropriate to a selected script/language context.
Composition and decomposition ccmp: combines or decomposes glyph sequences for subsequent shaping.
Distinct zero zero: slashed-zero design.

A feature tag does not prescribe only one lookup type in every case. Some case-related behavior, for example, can require positioning as well as alternate drawings. Supply the behavior that fits the registered purpose and the design.

Compose or decompose with ccmp

Shaping engines normally apply ccmp as part of default shaping rather than as a discretionary style choice. Glyph Composition/Decomposition can turn a sequence into one glyph or split one glyph into a sequence. One use is to represent an accented character as a base and combining mark so later attachment rules can position them; see Mark Attachment as Positioning.

This can let precomposed and decomposed input reach a common base-and-mark workflow. It still needs explicit rules or suitable generated behavior, the required component glyphs, and attachment data. The name ccmp does not automatically decompose every accented glyph or preserve the source's outline-component structure as text glyphs.

Test both input forms. A directly encoded precomposed glyph and a sequence of base plus combining mark can reach different initial glyph runs before normalization and feature processing.

Stylistic Sets and Positional Forms

Construction and automatic generation of these feature families are developed in Generated and Conditional Substitution.

A stylistic set, ss01 through ss20, groups designer-defined alternatives. The number identifies a feature slot, not a universal visual meaning: one font's ss01 might supply a single-storey a, while another's changes terminals.

Give a set a useful user-facing name when possible, and choose a coherent group of substitutions. Test it with other features that can change the same glyphs. If small caps run before the set, the set may need rules for small-cap inputs as well as ordinary letters.

Positional forms describe glyph variants appropriate to joining context: init, medi, fina, and isol identify initial, medial, final, and isolated forms. In connected scripts, the shaping engine determines where those forms apply according to the script's joining behavior. Position within a word is a useful first description, but neighboring nonjoining characters and marks also matter.

These features are not generic Latin word-boundary switches. To make a decorative initial or terminal in another context, write the appropriate contextual rules and test the intended script behavior.

Scripts and Languages

A language system identifies the script-and-language context in which features are selected. The same character can need a different glyph form in different language conventions; localized Cyrillic forms for Serbian or Bulgarian are examples of the role of locl.

The glyph's name alone does not tell an application which language the user is setting. Language-system declarations and testing controls are taught in The Features Panel.

The Preview language selector offers the languages supplied by the current font.

The Preview language selector offers the languages supplied by the current font.

A substitution belongs to a script/language context as well as to a feature. A rule associated with a different language system need not participate in the current text run.