Conditional Substitution

Replace glyphs only within a defined variation region when a design needs a different form. This is a layout decision; check the condition as well as the alternative drawing.

Conditional Substitution

A heavier part of a variable font may need a different drawing altogether. For example, you might draw dollar.heavy to replace dollar from weight 700 upward. This uses a conditional tag on the replacement glyph.

For a font whose weight axis code is wt and whose design range extends below and above 700:

  1. Prepare an encoded dollar and a drawn dollar.heavy, with suitable master compatibility, spacing, and anchors.
  2. Select dollar.heavy and add the tag dollar~wt>700 through the Glyph tags field or the Classes panel's Tags mode. In an additive tag-entry field, enter +dollar~wt>700.
  3. Preview text containing $ below, at, and above weight 700.
  4. Check the spacing and any mark attachment, then test the exported variable font too.

In FontLab's tag syntax, wt>700 includes the boundary: the replacement applies at 700 and above. The values are design coordinates for the named axis. Switching Glyphs Dynamically covers the complete tag syntax and the choice between early ~ and later ^ substitutions.

Conditional glyph tags describe designspace regions, while feature code describes the substitution actions. On variable TT or PS export, FontLab converts tilde tags to the GSUB rvrn feature for early required variation, and caret tags to GSUB rclt by default, or the configured target feature for later behavior.

An ordinary sub a by a.alt; rule contains no axis-range condition. Writing it inside a feature named rvrn does not by itself reproduce the tag's condition set. Use FontLab's conditional-tag workflow for its supported source-to-variable-output path; do not assume every external compiler's extended variation syntax is supported by FontLab's FEA editor.

The tag mechanism describes one-glyph-to-one-glyph replacements. A conditionally changing ligature operation is a more advanced GSUB variation construction, not a longer string of glyph names before the tag marker. It can require direct table-level work, such as a deliberately authored GSUB/TTX workflow, with careful preservation through export.

Test conditions together with other substitutions. A later rule needs the glyph produced by earlier processing, and an early replacement may require corresponding small-cap, figure, or ligature rules. Static character remapping and variable shaping are different output paths, so check the intended one explicitly.

Keep the native source and verify any import round trip. Recovered tags or decompiled feature text do not alone establish that every original condition, lookup association, or engine-dependent behavior was preserved.

Autogeneration of kern, mark, and mkmk is GPOS work, taught in Kerning, GPOS, and the kern Table and Mark Features and Export. Per-format resolution of conditional features is covered in Exporting OpenType Fonts.