# fonttools

> Tools to manipulate font files

- **URL**: https://www.freshcrate.ai/projects/fonttools
- **Author**: Just van Rossum
- **Category**: RAG & Memory
- **Latest version**: `4.63.0` (2026-05-14)
- **License**: MIT
- **Source**: http://github.com/fonttools/fonttools
- **Language**: Python
- **GitHub**: 5,081 stars, 515 forks
- **Registry**: pypi (`fonttools`)
- **Tags**: `pypi`

## Description

|CI Build Status| |Coverage Status| |PyPI| |Gitter Chat|

What is this?
~~~~~~~~~~~~~

| fontTools is a library for manipulating fonts, written in Python. The
  project includes the TTX tool, that can convert TrueType and OpenType
  fonts to and from an XML text format, which is also called TTX. It
  supports TrueType, OpenType, AFM and to an extent Type 1 and some
  Mac-specific formats. The project has an `MIT open-source
  license <LICENSE>`__.
| Among other things this means you can use it free of charge.

`User documentation <https://fonttools.readthedocs.io/en/latest/>`_ and
`developer documentation <https://fonttools.readthedocs.io/en/latest/developer.html>`_
are available at `Read the Docs <https://fonttools.readthedocs.io/>`_.

Installation
~~~~~~~~~~~~

FontTools requires `Python <http://www.python.org/download/>`__ 3.10
or later. We try to follow the same schedule of minimum Python version support as
NumPy (see `NEP 29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`__).

The package is listed in the Python Package Index (PyPI), so you can
install it with `pip <https://pip.pypa.io>`__:

.. code:: sh

    pip install fonttools

If you would like to contribute to its development, you can clone the
repository from GitHub, install the package in 'editable' mode and
modify the source code in place. We recommend creating a virtual
environment, using `virtualenv <https://virtualenv.pypa.io>`__ or
Python 3 `venv <https://docs.python.org/3/library/venv.html>`__ module.

.. code:: sh

    # download the source code to 'fonttools' folder
    git clone https://github.com/fonttools/fonttools.git
    cd fonttools

    # create new virtual environment called e.g. 'fonttools-venv', or anything you like
    python -m virtualenv fonttools-venv

    # source the `activate` shell script to enter the environment (Unix-like); to exit, just type `deactivate`
    . fonttools-venv/bin/activate

    # to activate the virtual environment in Windows `cmd.exe`, do
    fonttools-venv\Scripts\activate.bat

    # install in 'editable' mode
    pip install -e .

Optional Requirements
---------------------

The ``fontTools`` package currently has no (required) external dependencies
besides the modules included in the Python Standard Library.
However, a few extra dependencies are required by some of its modules, which
are needed to unlock optional features.
The ``fonttools`` PyPI distribution also supports so-called "extras", i.e. a
set of keywords that describe a group of additional dependencies, which can be
used when installing via pip, or when specifying a requirement.
For example:

.. code:: sh

    pip install fonttools[ufo,lxml,woff,unicode]

This command will install fonttools, as well as the optional dependencies that
are required to unlock the extra features named "ufo", etc.

- ``Lib/fontTools/misc/etree.py``

  The module exports a ElementTree-like API for reading/writing XML files, and
  allows to use as the backend either the built-in ``xml.etree`` module or
  `lxml <https://lxml.de>`__. The latter is preferred whenever present,
  as it is generally faster and more secure.

  *Extra:* ``lxml``

- ``Lib/fontTools/ttLib/woff2.py``

  Module to compress/decompress WOFF 2.0 web fonts; it requires:

  * `brotli <https://pypi.python.org/pypi/Brotli>`__: Python bindings of
    the Brotli compression library.

  *Extra:* ``woff``

- ``Lib/fontTools/ttLib/sfnt.py``

  To better compress WOFF 1.0 web fonts, the following module can be used
  instead of the built-in ``zlib`` library:

  * `zopfli <https://pypi.python.org/pypi/zopfli>`__: Python bindings of
    the Zopfli compression library.

  *Extra:* ``woff``

- ``Lib/fontTools/unicode.py``

  To display the Unicode character names when dumping the ``cmap`` table
  with ``ttx`` we use the ``unicodedata`` module in the Standard Library.
  The version included in there varies between different Python versions.
  To use the latest available data, you can install:

  * `unicodedata2 <https://pypi.python.org/pypi/unicodedata2>`__:
    ``unicodedata`` backport for Python 3.x updated to the latest Unicode
    version 17.0.

  *Extra:* ``unicode``

- ``Lib/fontTools/varLib/interpolatable.py``

  Module for finding wrong contour/component order between different masters.
  It requires one of the following packages in order to solve the so-called
  "minimum weight perfect matching problem in bipartite graphs", or
  the Assignment problem:

  * `scipy <https://pypi.python.org/pypi/scipy>`__: the Scientific Library
    for Python, which internally uses `NumPy <https://pypi.python.org/pypi/numpy>`__
    arrays and hence is very fast;
  * `munkres <https://pypi.python.org/pypi/munkres>`__: a pure-Python
    module that implements the Hungarian or Kuhn-Munkres algorithm. Slower than
    SciPy, but useful for minimalistic systems where adding SciPy is undesirable.

  This ensures both performance (via SciPy) and minimal footprint (via Munkres)
  are possible.

  To plot the result

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `4.63.0` | 2026-05-14 | High | - [ttLib] Add support for Apple Color Emoji `bgcl` table (#4065). - [ttLib] Add support for `IFT` and `IFTX` tables (Incremental Font Transfer, PatchMapFormat2) (#4070, #4072). - [otData] Introduce `FieldSpec` dataclass for OpenType table schema definitions, replacing raw tuples in `otData.py` (#4076). - [Feat] Show `name` table strings as comments next to label IDs in TTX output, matching the convention used by `fvar`, `STAT`, `trak` (#4089). - [cu2qu] Fix Cython complex-division rounding diffe |
| `4.62.1` | 2026-04-21 | Low | Imported from PyPI (4.62.1) |
| `4.62.0` | 2026-03-09 | Low | - [diff] Add new `fonttools diff` command for comparing font files, imported from the `fdiff` project and heavily reworked (#1190, #4007, #4009, #4011, #4013, #4019). - [feaLib] Fix `VariableScalar` interpolation bug with non-linear avar mappings. Also decouple `VariableScalar` from compiled fonts, allowing it to work with designspace data before compilation (#3938, #4054). - [feaLib] Fix `VariableScalar` axis ordering and iterative delta rounding to match fontc behavior (#4053). - [feaLib] Merg |
| `4.61.1` | 2025-12-12 | Low | - [otlLib] buildCoverage: return empty Coverage instead of None (#4003, #4004). - [instancer] bug fix in ``avar2`` full instancing (#4002). - [designspaceLib] Preserve empty conditionsets when serializing to XML (#4001). - [fontBu ilder] Fix FontBuilder ``setupOS2()`` default params globally polluted (#3996, #3997). - [ttFont] Add more typing annotations to ttFont, xmlWriter, sfnt, varLib.models and others (#3952, #3826). - Explicitly test and declare support for Python 3.14, even though we |
| `4.60.2` | 2025-12-09 | Low | - **Backport release** Same as 4.61.0 but without "Drop support for EOL Python 3.9" change to allow downstream projects still on Python 3.9 to avail of the security fix for CVE-2025-66034 (#3994, #3999). |
| `4.61.0` | 2025-11-28 | Low | - [varLib.main]: **SECURITY** Only use basename(vf.filename) to prevent path traversal attacks when running `fonttools varLib` command-line script, or code which invokes `fonttools.varLib.main()`. Fixes CVE-2025-66034, see: https://github.com/fonttools/fonttools/security/advisories/GHSA-768j-98cg-p3fv. - [feaLib] Sort BaseLangSysRecords by tag (#3986). - Drop support for EOL Python 3.9 (#3982). - [instancer] Support --remove-overlaps for fonts with CFF2 table (#3975). - [CFF2ToCFF] Add --rem |
| `4.60.1` | 2025-09-29 | Low | - [ufoLib] Reverted accidental method name change in ``UFOReader.getKerningGroupConversionRenameMaps``   that broke compatibility with downstream projects like defcon (#3948, #3947, robotools/defcon#478). - [ufoLib] Added test coverage for ``getKerningGroupConversionRenameMaps`` method (#3950). - [subset] Don't try to subset BASE table; pass it through by default instead (#3949). - [subset] Remove empty BaseRecord entries in MarkBasePos lookups (#3897, #3892). - [subset] Add pruning for Mar |
| `4.60.0` | 2025-09-17 | Low | - [pointPen] Allow ``reverseFlipped`` parameter of ``DecomposingPointPen`` to take a ``ReverseFlipped`` enum value to control whether/how to reverse contour direction of flipped components, in addition to the existing True/False. This allows to set ``ReverseFlipped.ON_CURVE_FIRST`` to ensure that the decomposed outline starts with an on-curve point before being reversed, for better consistency with other segment-oriented contour transformations. The change is backward compatible, and the default |
| `4.59.2` | 2025-08-27 | Low | - [varLib] Clear ``USE_MY_METRICS`` component flags when inconsistent across masters (#3912). - [varLib.instancer] Avoid negative advance width/height values when instatiating HVAR/VVAR, (unlikely in well-behaved fonts) (#3918). - [subset] Fix shaping behaviour when pruning empty mark sets (#3915, harfbuzz/harfbuzz#5499). - [cu2qu] Fixed ``dot()`` product of perpendicular vectors not always returning exactly 0.0 in all Python implementations (#3911) - [varLib.instancer] Implemented fully-ins |
| `4.59.1` | 2025-08-14 | Low | - [featureVars] Update OS/2.usMaxContext if possible after addFeatureVariationsRaw (#3894). - [vhmtx] raise TTLibError('not enough data...') when hmtx/vmtx are truncated (#3843, #3901). - [feaLib] Combine duplicate features that have the same set of lookups regardless of the order in which those lookups are added to the feature (#3895). - [varLib] Deprecate ``varLib.mutator`` in favor of ``varLib.instancer``. The latter provides equivalent full (static font) instancing in addition to partial |

## Citation

- HTML: https://www.freshcrate.ai/projects/fonttools
- Markdown: https://www.freshcrate.ai/projects/fonttools.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/fonttools/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
