OpenType at Work | Contextual Alternates
Our OpenType at Work series explains what OpenType features do and how to make the most of them. My recent spotlight on Tilda inspired me to take a look at contextual alternates—programmatic diplomats that improve relationships between glyphs.
The specific design of some typefaces can make it difficult for every single character to combine perfectly with all possible neighboring characters. Certain glyph1 shapes can cause issues when paired with certain other glyphs. Type designers get around this by drawing alternate shapes. They shorten cross strokes2 or overhangs3 to avoid collisions, for example, or remove serifs; they move outgoing strokes or alter their length to refine connections. Sometimes, designers introduce alternates simply because it makes the text look better—adding differentiation to repeating letters can achieve this, for instance. These altered glyphs are inserted via the OpenType feature known as Contextual Alternates (calt) to improve the overall word shape and setting.
Bald Condensed, né Yves Peters, is a Belgian-based rock drummer known for his astute observations on the impact of letterforms in the contemporary culture-sphere. A prolific writer on typography, he has a singular knack for identifying the most obscure typefaces known to man.
How does it work?
The Contextual Alternates feature is basically a search-and-replace routine that examines the text. It looks at every single glyph and its surrounding context and checks that against a built-in list of sequences that the type designer has identified as undesirable. The context can be one or more glyphs before or after said glyph, or even both. Whenever it encounters such a sequence, the calt feature replaces the problematic glyph with the desired alternate glyph. This happens automatically and in the background, dispensing with the need to scour glyph tables in search of the perfect substitute. Savvy type designers extend this feature to consider every reconfigured sequence and check it against neighboring characters again, swapping out additional characters to resolve any new issues. The feature not only works on existing, imported, or copy-pasted text, but also on live text. As you type, the font continuously checks to see which characters precede the one you just entered and inserts contextual alternates wherever needed.Ligatures and contextual alternates
Ligatures and contextual alternates basically serve the same purpose: they offer solutions for problematic or unwieldy glyph sequences. Although their name implies that they connect two or more glyphs, some ligatures actually solve problems by shortening letter parts, exactly like some contextual alternates do. So why are they two distinct features? The fundamental difference between them is that ligatures replace two or more glyphs with one combined glyph, while contextual alternates only change the appearance of one glyph at a time. A ligature typically resolves one single awkward glyph combination; a contextual alternate can offer solutions for many different graceless scenarios.Improving the appearance of text
Contextual alternates do more than tackle occasional collisions. In connected scripts, for example, alternates can be crucial for properly rendering the typeface. Different letters connect at different heights, so entry or exit strokes may have to be moved up or down to guarantee exact transitions. And when glyphs in their default form are drawn to seamlessly connect with adjacent glyphs, their incoming or outgoing strokes may not look right at the beginning or end of words. Contextual alternates are used to modify the nature of those entry or exit strokes to create more natural word beginnings and endings, as appropriate, in the absence of any preceding or following letters they need to connect to.Introducing variety
Beyond problem-solving, calt is typically the go-to feature for creating pseudo-randomness. Identical repeating characters are a dead giveaway that you’re looking at a font and not actual handwriting or lettering. To avoid having multiple occurrences of the same character in a sequence look the same, type designers program Contextual Alternates to make suitable substitutions. Designers who are especially clever can even consider proximities that are not necessarily adjacent, creating extensive and complex feature files that perform substitution upon substitution until an illusion of true randomness is achieved. Although such contextual alternates can be considered stylistic as opposed to purely functional, they don’t serve the same purpose as the Stylistic Alternates OpenType feature. With Contextual Alternates, the initiative comes from the type designer. Stylistic Alternates, on the other hand, are offered to users to apply at their discretion; the decision is entirely in their hands.When Contextual Alternates fail
Contextual Alternates should be activated by default. It’s always best to double-check, though, because they can be switched off. Some fonts may also include the Required Contextual Alternates (rclt) OpenType feature, which is permanently active if properly supported. Also, note that even if Contextual Alternates were switched on originally, certain actions can deactivate them without the user noticing. This can happen, for example, when you manually select an alternate glyph in a word, then copy and paste the text object and replace the existing text because you want to preserve the formatting. In her insightful and funny TYPO Labs 2018 presentation, Ulrike Rausch showcased this issue and some other instances where OpenType features fail. Although many typefaces have no need for contextual alternates, it’s always best to have the feature switched on, just in case. Unlike Stylistic Alternates, Contextual Alternates are more than an aesthetic choice; they’re often indispensable for solving certain thorny problems and improving the text image. Making sure they’re activated will make your text look the best it can.Support
Contextual Alternates are universally supported in all major apps and browsers.Notes
- A glyph is the visual representation of a character, be it a letter, a figure, a punctuation mark, a ligature, or any other alphanumeric character. The capital A and lowercase a are two different glyphs representing two different characters; but if, for example, a capital letter A exists in a standard form and as a swash variant, these are two different glyphs for the same character.↑
- A cross stroke is the (usually horizontal) stroke that intersects the stem of letters like f and t. ↑
- Overhang is the amount any letter extends beyond its expected boundaries. For example, if the hook on the f has a lot of overhang, it will intrude into the space of the subsequent letter. ↑
Bald Condensed, né Yves Peters, is a Belgian-based rock drummer known for his astute observations on the impact of letterforms in the contemporary culture-sphere. A prolific writer on typography, he has a singular knack for identifying the most obscure typefaces known to man.