Skip to content

Latest commit

 

History

History
133 lines (105 loc) · 4.68 KB

index.rst

File metadata and controls

133 lines (105 loc) · 4.68 KB

Font Tools

---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.

Installation

Note

fontTools requires Python 3.8 or later.

To install fontTools, use pip:

pip install fonttools

Utilities

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 values
  • cu2qu: Convert a UFO font from cubic to quadratic curves
  • feaLib: Add features from a feature file (.fea) into a OTF font
  • merge: Merge multiple fonts into one
  • subset: OpenType font subsetter and optimizer
  • ttx: Convert OpenType fonts to XML and back
  • varLib: Build a variable font from a designspace file and masters
  • varLib.instancer: Partially instantiate a variable font
  • voltLib.voltToFea: Convert MS VOLT to AFDKO feature files.

Libraries

The main library for font engineering is :pyfontTools.ttLib.ttFont, which handles TrueType/OpenType fonts. Other libraries include:

  • :pyfontTools.afmLib: Read and write AFM files
  • :pyfontTools.agl: Access the Adobe Glyph List
  • :pyfontTools.cffLib: Tools for Adobe CFF fonts
  • :pyfontTools.colorLib: Handle colors in CPAL/COLR fonts
  • :pyfontTools.cu2qu: Convert cubic to quadratic curves
  • :pyfontTools.designspaceLib: Read and write designspace files
  • :pyfontTools.encodings: Support for font-related encodings
  • :pyfontTools.feaLib: Read and write AFDKO feature files
  • :pyfontTools.fontBuilder: Construct TTF/OTF fonts from scratch
  • :pyfontTools.merge: Tools for merging font files
  • :pyfontTools.subset: OpenType font subsetting and optimization
  • :pyfontTools.svgLib.path: Draw SVG paths onto glyphs
  • :pyfontTools.ttLib: Read/write OpenType and TrueType fonts
  • :pyfontTools.ttx: Convert between OTF and XML representation
  • :pyfontTools.ufoLib: Read and write UFO files
  • :pyfontTools.unicodedata: Convert between Unicode and OpenType script info
  • :pyfontTools.varLib: Deal with 'gvar'-style font variations
  • :pyfontTools.voltLib: Deal with Visual OpenType Layout Tool (VOLT) files

Optional Dependencies

fontTools has no external dependencies besides the Python Standard Library. Some optional features require additional modules; see the optional requirements </optional> page for details.

Developer Information

For developer resources, refer to the developer information </developer>.

License

fontTools is licensed under the MIT license. Refer to the full text of the license for details.

Table of Contents

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