Testing OpenType Features in FontForge with External Tools
This article explains how to test OpenType features when working with FontForge, covering its built-in shaping capabilities, its limitations regarding direct GUI plugin integration, and how to effectively connect third-party testing tools using FontForge's Python scripting interface and external workflows.
While FontForge does not have a native plugin system that embeds third-party graphical testing interfaces directly inside its main window, you can seamlessly integrate external testing tools using FontForge’s embedded Python scripting environment or by establishing an automated external build pipeline.
FontForge's Native Testing Environment
Before configuring external tools, consider FontForge's built-in
Metrics Window (Window > New Metrics Window). Modern
distributions of FontForge utilize the HarfBuzz shaping engine under the
hood. By navigating to the Metrics Window, you can enable specific
OpenType features (such as ligatures, kerning, small caps, and
contextual alternates) directly from the Features menu
to preview how glyphs interact in real time.
Integrating Third-Party Tools via Python
FontForge provides a powerful Python module (fontforge)
that allows you to automate exports and interface directly with external
testing suites. Through Python scripts executed within FontForge or via
the command line, you can generate test fonts and immediately pass them
to external shaping and inspection tools:
- HarfBuzz (
hb-shapeandhb-view): HarfBuzz is the text-shaping engine used by Chrome, Firefox, Android, and many operating systems. You can write a FontForge Python script that generates a temporary.otfor.ttffile and callshb-shapeorhb-viewvia Python'ssubprocessmodule. This renders precise command-line or visual text-shaping outputs to verify glyph substitution (GSUB) and positioning (GPOS). - FontTools and TTX: You can pair FontForge with the FontTools Python library to decompile generated fonts into XML (TTX) format. This allows you to verify that OpenType lookup tables, script definitions, and feature tags were compiled correctly by FontForge’s OpenType tables engine.
- Crowbar: Crowbar is an external OpenType debugging tool built on top of HarfBuzz. While not run inside FontForge, you can configure a script in FontForge to automatically compile and launch Crowbar targeted at your output font, allowing you to step through feature execution lookup by lookup.
Web Browser and Desktop Application Testing
Real-world application testing is necessary because software engines handle OpenType features differently (for example, CoreText on macOS, DirectWrite on Windows, and FreeType/HarfBuzz on Linux).
You can automate this workflow by writing a FontForge script that:
- Generates
.woff2and.otfbinaries. - Updates a local HTML/CSS test page configured with
font-feature-settings. - Opens the page automatically in target web browsers to verify contextual substitutions and mark-to-base positioning in real-world rendering engines.
In summary, you cannot embed third-party graphical test panels directly into FontForge's native user interface, but you can achieve robust third-party testing integration by using FontForge's Python API to automate font compilation and trigger external shapers and inspection tools.