User Guide

FontLab 4
668
Context-Dependent Substitutions
A context-dependent rule can be any of the rules described above with one
important difference: it defines a context that must include a target
sequence of glyphs (or glyph classes).
In the simple form of, say, ligature substitution we simply write:
sub a b c by D;
In context-dependent substitution we can declare that “abc”, which is a
target sequence of glyphs for a ligature substitution rule, must be a part of
a larger context:
sub period a’ b’ c’ period by D;
Only when “abc” is surrounded by two “period” glyphs will substitution
take place. Note that we have marked the target glyphs with the single
quote character positioned immediately after the glyph name.
The rule is specified as follows:
substitute <marked glyph sequence> # Target sequence with marked glyphs
by <glyph sequence>; # Sub-run replacement sequence
A <glyph sequence> comprises one or more glyphs or glyph classes.
<marked glyph sequence> is a <glyph sequence> in which a set of glyphs
or glyph classes is identified, i.e. "marked". We will call this marked set of
glyphs a sub-run. A sub-run is marked by inserting a single quote (') after
each of its member elements.