Export OpenType Feature Files from FontForge

Exporting OpenType feature definitions from FontForge into an external file allows you to inspect, back up, or reuse layout logic such as ligatures, kerning, and stylistic alternates across different font projects. FontForge supports saving these definitions directly as Adobe Feature Files (.fea), a standard plain-text format compatible with AFDKO, Glyphs, and various font build pipelines. You can perform this export using either FontForge’s graphical user interface or its built-in Python scripting environment.

Method 1: Exporting via the File Menu

The quickest way to export your OpenType features in the standard FontForge interface is through the primary menu:

  1. Open your font file (.sfd, .otf, or .ttf) in FontForge.
  2. Click File in the top menu bar.
  3. Select Generate Feature File... from the dropdown menu.
  4. In the file browser, choose your desired save location.
  5. Enter a name for the file, ensuring it ends with the .fea extension (for example, features.fea).
  6. Click Save.

Method 2: Exporting via the Font Info Dialog

If the direct file menu option is unavailable in your version build, you can export feature definitions through the font's lookup settings:

  1. Open your font in FontForge.
  2. Navigate to Element > Font Info (or press Ctrl + Shift + F on Windows/Linux, Cmd + Shift + F on macOS).
  3. In the left-hand category list, select Lookups.
  4. Click the Save Feature File button located near the bottom of the dialog window.
  5. Select your target directory, assign a filename with the .fea extension, and confirm by clicking Save.
  6. Click OK to close the Font Info window.

Method 3: Exporting via Python Scripting

If you automate font builds or work in a headless environment, you can export the OpenType feature file programmatically using FontForge's Python module:

import fontforge

# Open the target font
font = fontforge.open("path/to/your/font.sfd")

# Generate the Adobe feature file
font.generateFeatureFile("output_features.fea")

# Close the font
font.close()

Run this script using the FontForge binary directly from your terminal:

fontforge -script export_features.py

What the Exported File Contains

The generated .fea file uses Adobe's standard OpenType Feature File syntax. It contains all existing lookups categorized into their respective OpenType feature tags (such as liga, kern, calt, and smcp), glyph class definitions, and subtable structures present in your font. You can edit this file in any plain-text editor and import it into another font via File > Merge Feature File....