LinuxCommandLibrary

fonttools

Manipulate font files

TLDR

Subset a TTF font file to the Basic Latin Unicode block

$ fonttools subset [path/to/font.ttf] --unicodes=U+0000-007F
copy

Display help
$ fonttools --help
copy

SYNOPSIS

fonttools [OPTIONS] COMMAND [ARGS]...

fonttools COMMAND --help
fonttools --help

PARAMETERS

-h, --help
    Show this message and exit.

--version
    Show the version and exit.

--verbose / --quiet
    Increase/decrease verbosity (repeatable).

--log LOGFILE
    Write logs to specified file.

DESCRIPTION

FontTools is a comprehensive Python library and associated command-line interface for reading, writing, and manipulating font files in formats like TrueType (TTF), OpenType (OTF), WOFF, WOFF2, and variable fonts. On Linux, the fonttools command provides a unified entry point for numerous subcommands, enabling tasks such as converting fonts to/from XML (ttx), creating optimized subsets for web use (pyftsubset), merging multiple fonts (pyftmerge), compressing to WOFF2, inspecting glyph data, fixing font issues, and generating font proofs or documentation.

It excels in font development workflows, web font optimization, and batch processing, supporting advanced features like COLR/CPAL layered fonts, SVG fonts, and UFO sources. Installed via pip install fonttools or system packages like python3-fonttools, it's cross-platform and scriptable, making it essential for typographers, designers, and developers handling font assets on Linux systems.

Unlike traditional tools, it offers programmatic precision without proprietary software, with extensive documentation and active community support.

CAVEATS

Python dependency required; install via pip install fonttools or distro package. Each subcommand has unique options—always check fonttools COMMAND --help. Not all font formats fully supported; test subsets thoroughly. Large fonts may consume significant memory.

KEY SUBCOMMANDS

ttx: TTF/OTF <-> XML.
pyftsubset: Extract glyph subsets.
woff2: Compress/decompress WOFF2.
pyftmerge: Combine fonts.
check: Validate font integrity.

INSTALLATION

Debian/Ubuntu: sudo apt install fonttools.
Fedora: sudo dnf install python3-fonttools.
PyPI: pip install fonttools.

HISTORY

Developed by Just van Rossum at Letterror (~2005) as a TTX tool. Evolved into full FontTools library. CLI unified under fonttools in v4.0 (2017). Now v4.51+, maintained by community on GitHub with contributions from Google, Adobe, and font foundries.

SEE ALSO

Copied to clipboard