LinuxCommandLibrary

fontforge

Edit and create font files

SYNOPSIS

fontforge [-script scriptfile] [-c script-string] [-lang language] [-new] [-quit] [-dry] [-csv file] [-depth num] [-display display] [-sync] [-version] [-usage] [-help] [fontfile ...]

PARAMETERS


    One or more font files to open or process. If no files are specified, FontForge starts with an empty font.

-script scriptfile
    Executes the specified script file. FontForge can run scripts written in its own language or Python. If this option is used, FontForge typically operates in a non-GUI mode unless the script explicitly invokes the GUI.

-c script-string
    Executes a string as a script. This is useful for short, inline scripting commands, often used in conjunction with -quit for batch operations.

-lang language
    Sets the user interface language. For example, 'en' for English, 'fr' for French.

-new
    Starts FontForge with a new, empty font. This is the default if no font files are specified.

-quit
    Exits FontForge immediately after executing a script or processing command-line arguments. Essential for batch processing.

-dry
    Performs a 'dry run' for scripting operations, meaning it will not save any changes to files. Useful for testing scripts.

-csv file
    Outputs character information (glyph names, encodings, etc.) to the specified CSV file.

-depth num
    Sets the display depth (color depth) for the X server. Relevant for GUI mode.

-display display
    Specifies the X display to use. Standard X option.

-sync
    Synchronizes X operations. Can be useful for debugging display issues.

-version
    Prints the FontForge version information and exits.

-usage
    Prints a brief usage message and exits.

-help
    Prints a detailed help message describing command-line options and exits.

DESCRIPTION

FontForge is a powerful open-source font editor that allows users to create, modify, and convert various font formats. It supports a wide array of outline font formats, including TrueType, OpenType, PostScript Type1, CID-keyed PostScript, multi-master fonts, and SVG fonts. Beyond its graphical user interface for detailed glyph editing, FontForge offers extensive scripting capabilities, allowing for automated font manipulation, batch processing, and complex transformations using either its internal scripting language or Python. This makes it an invaluable tool for professional typographers, font designers, and developers working with typography, enabling precise control over character shapes, kerning, hinting, and font metrics. It is widely used in the open-source community for developing and maintaining free fonts.

CAVEATS

FontForge's primary mode of operation involves a graphical user interface (GUI), which typically requires an X server running on Linux systems. When used without an X server, or for automated tasks, it relies heavily on its powerful scripting capabilities (via -script or -c options) as the GUI will not be available. While extremely versatile, its extensive features can present a steep learning curve for new users, particularly for advanced font design concepts like hinting and OpenType features.

SCRIPTING CAPABILITIES

FontForge's strength lies significantly in its scripting capabilities, supporting both its own internal scripting language and Python. This allows users to automate complex font operations, such as applying transformations to all glyphs, generating font variants, or performing format conversions in batch. This headless operation is crucial for integration into build systems or for large-scale font processing tasks without manual GUI interaction.

BATCH PROCESSING

The command-line interface, especially when combined with the -script or -c options and the -quit flag, enables FontForge to be used effectively for batch processing. This means it can be invoked from shell scripts to convert hundreds of font files from one format to another, apply a set of standard corrections, or generate different font versions (e.g., hinted vs. unhinted) automatically, greatly enhancing productivity for font developers.

HISTORY

FontForge was originally created by George Williams under the name PfaEdit, with the first version released in 2001. It was developed to provide a free and open-source alternative to commercial font editing software. Renamed to FontForge, it quickly became a cornerstone tool for the open-source typography community, enabling the creation and modification of numerous libre fonts. Its development has been community-driven since George Williams stepped down from active maintenance, ensuring its continued evolution and adaptation to new font technologies and user needs. It remains the go-to open-source solution for comprehensive font development.

SEE ALSO

ttfautohint(1), pstoedit(1), potrace(1), gs(1)

Copied to clipboard