Editing and Previewing Lookup Rules
Edit the operands of a substitution or positioning rule and compare its input and result, including contextual calls.
Open Window > Panels > Lookups, choose the script and language, and select the feature, lookup, and rule to edit. Use the visual editor rather than Debugger mode. For the browser and document model, see Debugging OpenType Layout.
Editing Rules and Reading the Preview
Use + and − beside the relevant list to add or remove features, lookups, or rules. When adding a lookup, choose its operation type and give it a useful name. A new lookup already contains its first empty rule. Use the rule list’s ordering buttons when you need to move a rule within that lookup.
Feature membership and lookup definitions are distinct. Removing a lookup’s assignment from one feature does not necessarily remove its shared definition: another feature or contextual caller may still use it. In particular, a lookup intended to run only through context should not also be assigned directly to an active feature, where it could run outside that context.
The Shapes column shows glyph samples, while the adjoining text describes the rule. For a substitution, choose the input and replacement glyphs using the glyph/class picker, or double-click the substitution text to edit it. For example, f i -> f_i describes a ligature rule; all three named glyphs must already exist. A complete exercise is in Substitution Lookups.
In the rule preview, the left canvas is the input and the right canvas is the result. Both use the same scale. Glyph names beneath the canvases identify the displayed samples. The background fill shows glyph bounds; faint dashed metric lines and the baseline help you compare placement. The arrowed width measurement shows advance width, which can differ from the width of the drawn outline. Drag the separator above the preview to adjust its height.
Blue glyphs are samples from classes. Click a blue glyph on either side to choose another member for the preview. This changes the sample, not the class membership. Use the Classes panel to edit the class itself; see Glyph Classes.
For single or pair positioning, the X and Y fields change placement and the width field changes advance. Placement moves the glyph relative to its origin; advance moves the origin used for the following glyph. Attachment rules instead identify the anchors involved. For mark-to-ligature attachment, use Component to inspect the receiving component. A missing-anchor diagnostic identifies data to inspect, not a successful attachment.
Where device corrections are available, choose the ppem size, glyph, and positioning field, then set or remove the pixel correction for that size. Stored OpenType lookup flags are retained; the preview’s direction follows the script and glyphs.
Visual positioning values are not automatically separate per-master values. For positioning that must interpolate across a designspace, use the appropriate kerning or anchor workflow described in Kerning Visually and Attaching Marks.
Context and Referenced Lookups
A summary such as @mark — apply mark_4 means: match a glyph belonging to @mark, then apply the lookup named mark_4. The name after apply identifies another lookup, not an output glyph. Its operation supplies the actual substitution or positioning.
Each action specifies an input position, counted from 1, and the lookup to apply there. The position counts the matched input, excluding surrounding context. Click the lookup name to open the searchable chooser; it narrows candidates to compatible lookups in the feature where possible. The compact + beside the controls adds another action at the selected input position. The other controls open the called lookup, move an action up, or remove it.
Open takes you to the referenced definition. Back to calling lookup returns with the previous script, language, feature, and filters. If the reference covers several imported parts, choose the part to inspect.
Expand Context to specify the surrounding pattern. Before and After refer to logical text order, including for right-to-left scripts. Spaces separate pattern positions; @name selects a class, and {A V} matches either glyph at one position. An empty field, shown as Any, leaves that side unconstrained. Use the eye button beside a context field to preview its class members and choose a representative sample.
The context rule preview shows the input on the left and the effects of the referenced lookups on the right. Gray glyphs are the surrounding context. Use Use in debugger to insert the sampled context and input into the debugger and immediately shape it. Then alter the input to test a case that should not match. The worked contextual editing procedure is in Contextual Substitution.
Test a Context and Set Lookup Flags
Try a contextual rule with your own text as well as automatic examples. The panel remembers the selected lookup, sample text, and settings per font. Use Ignore ligatures when ligature glyphs should be skipped by the lookup, then trace a sample containing those glyphs to check the flag’s effect.