Home › Eckher Insights › Converting fonts with FontForge using the command line on macOS
Jan 30, 2022

Converting fonts with FontForge using the command line on macOS

How to convert font files using FontForge's scripting language on macOS?

FontForge is a powerful tool for creating and editing fonts. It is available for multiple platforms, including macOS, Windows, and Linux, and can be run programmatically from the command line.

On macOS, FontForge is installed in the /Applications/ directory. When running FontForge scripts from the command line, the FontForge executable must be used which is located at /Applications/

FontForge scripts can be written either in Python (-lang=py) or using FontForge's native scripting language (-lang=ff or -lang=pe). Another way to specify the scripting language is to set the FONTFORGE_LANGUAGE environment variable.

Below is a complete example of using the FontForge CLI to convert a TTF font to an SVG font that relies on FontForge's native scripting:

/Applications/ -lang=ff -c 'Open($1); Generate($2)' my-font.ttf my-font.svg

See also
Google Sans Text
What is Google Sans Text and when was it first released?
Eckher Math Editor
Create publication-quality formulas in your browser.
Your guide to what's next.
Copyright © 2022 Eckher. Various trademarks held by their respective owners.
Your guide to what's next.