---fontTools Documentation---======= About -----
fontTools is a family of libraries and utilities for manipulating fonts in Python.
The project is licensed under the MIT open-source license, allowing free usage.
Note
fontTools requires Python 3.8 or later.
To install fontTools, use pip:
pip install fonttools
fontTools includes the following command-line utilities:
pyftmerge
: Tool for merging fonts; see :pyfontTools.merge
pyftsubset
: Tool for subsetting fonts; see :pyfontTools.subset
ttx
: Tool for converting between OTF and XML representation; see :pyfontTools.ttx
fonttools
: Meta-tool for accessing other fontTools components.
For fonttools
, you can use subcommands like:
cffLib.width
: Calculate optimum defaultWidthX/nominalWidthX valuescu2qu
: Convert a UFO font from cubic to quadratic curvesfeaLib
: Add features from a feature file (.fea) into a OTF fontmerge
: Merge multiple fonts into onesubset
: OpenType font subsetter and optimizerttx
: Convert OpenType fonts to XML and backvarLib
: Build a variable font from a designspace file and mastersvarLib.instancer
: Partially instantiate a variable fontvoltLib.voltToFea
: Convert MS VOLT to AFDKO feature files.
The main library for font engineering is :pyfontTools.ttLib.ttFont
, which handles TrueType/OpenType fonts. Other libraries include:
- :py
fontTools.afmLib
: Read and write AFM files - :py
fontTools.agl
: Access the Adobe Glyph List - :py
fontTools.cffLib
: Tools for Adobe CFF fonts - :py
fontTools.colorLib
: Handle colors in CPAL/COLR fonts - :py
fontTools.cu2qu
: Convert cubic to quadratic curves - :py
fontTools.designspaceLib
: Read and write designspace files - :py
fontTools.encodings
: Support for font-related encodings - :py
fontTools.feaLib
: Read and write AFDKO feature files - :py
fontTools.fontBuilder
: Construct TTF/OTF fonts from scratch - :py
fontTools.merge
: Tools for merging font files - :py
fontTools.subset
: OpenType font subsetting and optimization - :py
fontTools.svgLib.path
: Draw SVG paths onto glyphs - :py
fontTools.ttLib
: Read/write OpenType and TrueType fonts - :py
fontTools.ttx
: Convert between OTF and XML representation - :py
fontTools.ufoLib
: Read and write UFO files - :py
fontTools.unicodedata
: Convert between Unicode and OpenType script info - :py
fontTools.varLib
: Deal with 'gvar'-style font variations - :py
fontTools.voltLib
: Deal with Visual OpenType Layout Tool (VOLT) files
fontTools has no external dependencies besides the Python Standard Library. Some optional features require additional modules; see the optional requirements </optional>
page for details.
For developer resources, refer to the developer information </developer>
.
fontTools is licensed under the MIT license. Refer to the full text of the license for details.
afmLib agl cffLib/index colorLib/index config cu2qu/index designspaceLib/index encodings/index feaLib/index merge misc/index mtiLib otlLib/index pens/index subset/index svgLib/index t1Lib tfmLib ttLib/index ttx ufoLib/index unicode unicodedata/index varLib/index voltLib/index