2018-10-20 23:08:24 -04:00
.. image :: ../../Icons/FontToolsIconGreenCircle.png
:width: 200px
:height: 200px
:alt: Font Tools
:align: center
2017-04-21 19:47:28 -03:00
2024-04-26 19:37:59 +05:30
---fontTools Documentation---
=======
2018-10-11 11:46:36 -04:00
About
-----
2020-05-03 21:06:56 +01:00
fontTools is a family of libraries and utilities for manipulating fonts in Python.
2018-10-11 11:46:36 -04:00
2024-04-26 19:14:07 +05:30
The project is licensed under the `MIT open-source license <https://github.com/fonttools/fonttools/blob/main/LICENSE> `_ , allowing free usage.
2018-10-11 11:46:36 -04:00
Installation
------------
2020-04-20 16:35:51 -04:00
.. note ::
2023-03-10 15:37:13 +00:00
fontTools requires `Python <http://www.python.org/download/> `_ 3.8 or later.
2018-10-11 11:46:36 -04:00
2024-04-26 19:14:07 +05:30
To install fontTools, use `pip <https://pip.pypa.io/> `_ :
2018-10-11 11:46:36 -04:00
2024-04-26 19:14:07 +05:30
pip install fonttools
2018-10-11 11:46:36 -04:00
2020-05-03 21:06:56 +01:00
Utilities
---------
2018-10-11 11:46:36 -04:00
2024-04-26 19:14:07 +05:30
fontTools includes the following command-line utilities:
2018-10-11 11:46:36 -04:00
2024-04-26 19:14:07 +05:30
- `` pyftmerge `` : Tool for merging fonts; see :py:mod: `fontTools.merge`
- `` pyftsubset `` : Tool for subsetting fonts; see :py:mod: `fontTools.subset`
- `` ttx `` : Tool for converting between OTF and XML representation; see :py:mod: `fontTools.ttx`
- `` fonttools `` : Meta-tool for accessing other fontTools components.
2018-10-11 11:46:36 -04:00
2024-04-26 19:14:07 +05:30
For `` fonttools `` , you can use subcommands like:
2020-05-03 22:04:55 +01:00
2020-05-07 14:55:55 +01:00
- `` cffLib.width `` : Calculate optimum defaultWidthX/nominalWidthX values
- `` cu2qu `` : Convert a UFO font from cubic to quadratic curves
2020-05-03 22:04:55 +01:00
- `` feaLib `` : Add features from a feature file (.fea) into a OTF font
2020-05-07 14:55:55 +01:00
- `` merge `` : Merge multiple fonts into one
2020-05-03 22:04:55 +01:00
- `` subset `` : OpenType font subsetter and optimizer
2020-05-07 14:55:55 +01:00
- `` ttx `` : Convert OpenType fonts to XML and back
2020-05-03 22:04:55 +01:00
- `` varLib `` : Build a variable font from a designspace file and masters
2024-04-26 19:14:07 +05:30
- `` varLib.instancer `` : Partially instantiate a variable font
2023-06-14 20:35:20 +03:00
- `` voltLib.voltToFea `` : Convert MS VOLT to AFDKO feature files.
2018-10-11 11:46:36 -04:00
2020-05-03 21:06:56 +01:00
Libraries
---------
2018-10-11 11:46:36 -04:00
2024-04-26 19:14:07 +05:30
The main library for font engineering is :py:mod: `fontTools.ttLib.ttFont` , which handles TrueType/OpenType fonts. Other libraries include:
- :py:mod: `fontTools.afmLib` : Read and write AFM files
- :py:mod: `fontTools.agl` : Access the Adobe Glyph List
- :py:mod: `fontTools.cffLib` : Tools for Adobe CFF fonts
- :py:mod: `fontTools.colorLib` : Handle colors in CPAL/COLR fonts
- :py:mod: `fontTools.cu2qu` : Convert cubic to quadratic curves
2020-05-03 22:04:55 +01:00
- :py:mod: `fontTools.designspaceLib` : Read and write designspace files
2024-04-26 19:14:07 +05:30
- :py:mod: `fontTools.encodings` : Support for font-related encodings
- :py:mod: `fontTools.feaLib` : Read and write AFDKO feature files
2020-05-03 22:04:55 +01:00
- :py:mod: `fontTools.fontBuilder` : Construct TTF/OTF fonts from scratch
- :py:mod: `fontTools.merge` : Tools for merging font files
- :py:mod: `fontTools.subset` : OpenType font subsetting and optimization
2024-04-26 19:14:07 +05:30
- :py:mod: `fontTools.svgLib.path` : Draw SVG paths onto glyphs
- :py:mod: `fontTools.ttLib` : Read/write OpenType and TrueType fonts
- :py:mod: `fontTools.ttx` : Convert between OTF and XML representation
- :py:mod: `fontTools.ufoLib` : Read and write UFO files
- :py:mod: `fontTools.unicodedata` : Convert between Unicode and OpenType script info
- :py:mod: `fontTools.varLib` : Deal with 'gvar'-style font variations
- :py:mod: `fontTools.voltLib` : Deal with Visual OpenType Layout Tool (VOLT) files
2018-10-11 11:46:36 -04:00
2020-05-03 22:04:55 +01:00
Optional Dependencies
2018-10-11 11:46:36 -04:00
---------------------
2024-04-26 19:14:07 +05:30
fontTools has no external dependencies besides the Python Standard Library. Some optional features require additional modules; see the :doc: `optional requirements </optional>` page for details.
2018-10-11 11:46:36 -04:00
2024-04-26 19:14:07 +05:30
Developer Information
2018-10-11 11:46:36 -04:00
---------------------
2024-04-26 19:14:07 +05:30
For developer resources, refer to the :doc: `developer information </developer>` .
2018-10-11 11:46:36 -04:00
License
-------
2024-04-26 19:14:07 +05:30
fontTools is licensed under the `MIT license <https://github.com/fonttools/fonttools/blob/main/LICENSE> `_ . Refer to the full text of the license for details.
2018-10-11 11:46:36 -04:00
Table of Contents
-----------------
2017-04-21 19:47:28 -03:00
.. toctree ::
2018-10-10 22:34:52 -04:00
:maxdepth: 2
2018-10-20 23:17:37 -04:00
:caption: Library
2017-04-21 19:47:28 -03:00
afmLib
agl
2018-10-10 15:57:36 -04:00
cffLib/index
2020-04-20 17:36:25 -04:00
colorLib/index
2022-04-14 15:23:38 +01:00
config
2020-04-20 17:43:06 -04:00
cu2qu/index
2017-11-29 12:03:34 +00:00
designspaceLib/index
2018-10-10 18:03:29 -04:00
encodings/index
2018-10-10 18:24:35 -04:00
feaLib/index
2017-04-21 19:47:28 -03:00
merge
misc/index
2018-10-10 22:34:52 -04:00
mtiLib
otlLib/index
2017-04-21 19:47:28 -03:00
pens/index
2020-04-20 17:52:35 -04:00
subset/index
2018-10-10 22:34:52 -04:00
svgLib/index
2017-04-21 19:47:28 -03:00
t1Lib
2021-07-05 16:08:04 +02:00
tfmLib
2017-04-21 19:47:28 -03:00
ttLib/index
ttx
2018-10-19 20:58:57 -04:00
ufoLib/index
2018-10-10 22:34:52 -04:00
unicode
unicodedata/index
2017-04-21 19:47:28 -03:00
varLib/index
2023-06-14 20:35:20 +03:00
voltLib/index
2017-04-21 19:47:28 -03:00
2018-10-22 19:24:59 -04:00
.. |Travis Build Status| image :: https://travis-ci.org/fonttools/fonttools.svg
:target: https://travis-ci.org/fonttools/fonttools
.. |Appveyor Build status| image :: https://ci.appveyor.com/api/projects/status/0f7fmee9as744sl7/branch/master?svg=true
:target: https://ci.appveyor.com/project/fonttools/fonttools/branch/master
2022-11-09 10:11:02 +05:30
.. |Coverage Status| image :: https://codecov.io/gh/fonttools/fonttools/branch/main/graph/badge.svg
2018-10-22 19:24:59 -04:00
:target: https://codecov.io/gh/fonttools/fonttools
.. |PyPI| image :: https://img.shields.io/pypi/v/fonttools.svg
:target: https://pypi.org/project/FontTools
.. |Gitter Chat| image :: https://badges.gitter.im/fonttools-dev/Lobby.svg
:alt: Join the chat at https://gitter.im/fonttools-dev/Lobby
2022-04-14 15:23:38 +01:00
:target: https://gitter.im/fonttools-dev/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge