How to Link Stylistic Alternates in FontForge
Linking stylistic alternates to base glyphs in FontForge requires
setting up OpenType Layout tables using the Glyph Substitution (GSUB)
mechanism. By creating a Single Substitution lookup assigned to features
like Stylistic Alternates (salt) or Stylistic Sets
(ss01–ss20), you can map standard characters
to their decorative or contextual variants so design software can switch
between them seamlessly.
Step 1: Create and Name Your Alternate Glyphs
Before configuring the OpenType feature, ensure your alternate glyphs exist and follow standard naming conventions.
- Open your font project in FontForge.
- Create an empty glyph slot for your alternate (via Encoding > Add Unencoded Glyphs if needed).
- Draw or paste your alternate artwork into this slot.
- Open the glyph properties (Element > Glyph Info).
- Name the glyph logically relative to the base glyph. For example, if
the base glyph is
a, name the alternatea.alt(for a general stylistic alternate) ora.ss01(for Stylistic Set 1).
Step 2: Create a GSUB Lookup
To define how the base glyph transforms into the alternate, you must configure a GSUB lookup table.
- Go to Element in the top menu and select Font Info.
- In the left navigation panel, select Lookups.
- Click the GSUB tab at the top of the Lookups window.
- Click Add Lookup.
- Set the Type dropdown to Single Substitution.
- Under the Feature column, choose your desired
feature tag:
- Select
salt Stylistic Alternatesfor general alternates. - Select
ss01throughss20if you want the alternate tied to a specific stylistic set.
- Select
- Click OK.
Step 3: Add a Subtable and Map Glyphs
A lookup requires a subtable to define the specific glyph-to-glyph relationships.
- Highlight the lookup you just created in the Lookups list.
- Click Add Subtable.
- Accept the default subtable name and click OK.
- In the subtable dialog, you will map the base glyphs to the
alternate glyphs:
- Manual Mapping: Click the Add
button, enter the base glyph name (e.g.,
a) in the first column, and enter the alternate glyph name (e.g.,a.alt) in the second column. - Automatic Mapping (Suffix Matching): If your glyphs
use consistent suffixes (such as
.altor.ss01), click Populate with matching suffixes. Enter the suffix you used, and FontForge will automatically map all matching pairs.
- Manual Mapping: Click the Add
button, enter the base glyph name (e.g.,
- Click OK to close the subtable window, then click OK again to apply the changes in Font Info.
Step 4: Validate and Export
Test the OpenType substitution to ensure the mapping works correctly before publishing the font.
- Open the metrics window via Metrics > New Metrics Window.
- Type the base character into the text field.
- Open the Features menu within the metrics window
and toggle the feature you created (
saltorss01). The base glyph should automatically switch to your alternate version. - Go to File > Generate Fonts to export your font as an OpenType (OTF or TTF) file with layout tables enabled.