How to Define Custom OpenType Features in FontForge
FontForge fully supports creating and applying custom OpenType feature tags, allowing font designers to create specialized layout behavior beyond the default feature lists. While FontForge gives you the interface to input arbitrary four-character tags into GSUB (substitution) and GPOS (positioning) lookup tables, the actual rendering of these custom features depends entirely on the text-shaping engine used by the host application. This article explains how to define custom tags in FontForge, rules for formatting them, and practical considerations regarding application support.
How to Create Custom Feature Tags in FontForge
Custom OpenType features are added through the Lookups section of FontForge's Font Info window.
- Open your font file in FontForge.
- Go to Element > Font Info from
the main menu, or press
Ctrl + Shift + F(Cmd + Shift + Fon macOS). - Select the Lookups tab on the left panel.
- Select either GSUB (for glyph substitution) or GPOS (for glyph positioning), depending on what action the feature performs.
- Click Add Lookup.
- Choose the Type of lookup (e.g., Single Substitution, Ligature Substitution, Pair Position).
- In the feature configuration area, double-click an empty row under
the Feature list or select the dropdown. Instead of
choosing a predefined tag (like
ligaorkern), manually type your custom four-character tag into the field. - Choose your target scripts and languages (such as
latn{dflt}) to define when the feature applies. - Click OK, then add subtables to specify the glyph mapping rules associated with this tag.
- Generate the font (
File>Generate Fonts) as an OpenType (CFF) or TrueType font to compile the tables.
Tag Formatting Rules
All OpenType feature tags must comply with standard OpenType specifications:
- Length: Tags must consist of exactly four ASCII characters. If a identifier has fewer than four characters, it must be padded with trailing spaces.
- Characters: Use printable ASCII characters within
the range of
0x20to0x7E. Typically, lowercase alphanumeric characters are preferred for custom additions. - Collisions: Avoid using existing standardized tags
defined by Microsoft and Adobe (such as
calt,dlig,smcp) unless you intend to follow their standard layout behaviors.
Rendering Engine Support and Compatibility
Defining a custom tag inside a font does not guarantee that software will execute it. Most general-purpose software relies on text layout engines such as HarfBuzz, CoreText, or DirectWrite. These shaping engines only process standard registered OpenType features automatically.
However, custom tags can still be used in specific environments:
Web Browsers: Modern browsers using CSS can trigger custom tags via low-level font controls, provided the layout engine does not strip unrecognized tags:
font-feature-settings: "cust" 1;Custom Software and Game Engines: Applications using custom text rendering pipelines or low-level HarfBuzz integrations can query and activate non-standard feature tags directly.
The Recommended Alternative: Stylistic Sets
If your font needs custom behavior that must work across standard
design applications (such as Adobe InDesign, Illustrator, or Affinity
Designer), do not use arbitrary custom tags. Instead, map your custom
behaviors to the standardized Stylistic Sets (ss01 through
ss20) or Character Variants (cv01 through
cv99). These tags are widely recognized by desktop
publishing software and provide native user-interface controls for end
users.