1.. image:: ../../Icons/FontToolsIconGreenCircle.png 2 :width: 200px 3 :height: 200px 4 :alt: Font Tools 5 :align: center 6 7 8fontTools Docs 9============== 10 11About 12----- 13 14fontTools is a family of libraries and utilities for manipulating fonts in Python. 15 16The project has an `MIT open-source license <https://github.com/fonttools/fonttools/blob/master/LICENSE>`_. Among other things this means you can use it free of charge. 17 18Installation 19------------ 20 21.. note:: 22 23 fontTools requires `Python <http://www.python.org/download/>`_ 3.6 or later. 24 25The package is listed in the Python Package Index (PyPI), so you can install it with `pip <https://pip.pypa.io/>`_:: 26 27 pip install fonttools 28 29See the Optional Requirements section below for details about module-specific dependencies that must be installed in select cases. 30 31Utilities 32--------- 33 34fontTools installs four command-line utilities: 35 36- ``pyftmerge``, a tool for merging fonts; see :py:mod:`fontTools.merge` 37- ``pyftsubset``, a tool for subsetting fonts; see :py:mod:`fontTools.subset` 38- ``ttx``, a tool for converting between OpenType binary fonts (OTF) and an XML representation (TTX); see :py:mod:`fontTools.ttx` 39- ``fonttools``, a "meta-tool" for accessing other components of the fontTools family. 40 41This last utility takes a subcommand, which could be one of: 42 43- ``cffLib.width``: Calculate optimum defaultWidthX/nominalWidthX values 44- ``cu2qu``: Convert a UFO font from cubic to quadratic curves 45- ``feaLib``: Add features from a feature file (.fea) into a OTF font 46- ``help``: Show this help 47- ``merge``: Merge multiple fonts into one 48- ``mtiLib``: Convert a FontDame OTL file to TTX XML 49- ``subset``: OpenType font subsetter and optimizer 50- ``ttLib.woff2``: Compress and decompress WOFF2 fonts 51- ``ttx``: Convert OpenType fonts to XML and back 52- ``varLib``: Build a variable font from a designspace file and masters 53- ``varLib.instancer``: Partially instantiate a variable font. 54- ``varLib.interpolatable``: Test for interpolatability issues between fonts 55- ``varLib.interpolate_layout``: Interpolate GDEF/GPOS/GSUB tables for a point on a designspace 56- ``varLib.models``: Normalize locations on a given designspace 57- ``varLib.mutator``: Instantiate a variation font 58- ``varLib.varStore``: Optimize a font's GDEF variation store 59 60Libraries 61--------- 62 63The main library you will want to access when using fontTools for font 64engineering is likely to be :py:mod:`fontTools.ttLib`, which is the package 65for handling TrueType/OpenType fonts. However, there are many other 66libraries in the fontTools suite: 67 68- :py:mod:`fontTools.afmLib`: Module for reading and writing AFM files 69- :py:mod:`fontTools.agl`: Access to the Adobe Glyph List 70- :py:mod:`fontTools.cffLib`: Read/write tools for Adobe CFF fonts 71- :py:mod:`fontTools.colorLib`: Module for handling colors in CPAL/COLR fonts 72- :py:mod:`fontTools.cu2qu`: Module for cubic to quadratic conversion 73- :py:mod:`fontTools.designspaceLib`: Read and write designspace files 74- :py:mod:`fontTools.encodings`: Support for font-related character encodings 75- :py:mod:`fontTools.feaLib`: Read and read AFDKO feature files 76- :py:mod:`fontTools.fontBuilder`: Construct TTF/OTF fonts from scratch 77- :py:mod:`fontTools.merge`: Tools for merging font files 78- :py:mod:`fontTools.pens`: Various classes for manipulating glyph outlines 79- :py:mod:`fontTools.subset`: OpenType font subsetting and optimization 80- :py:mod:`fontTools.svgLib.path`: Library for drawing SVG paths onto glyphs 81- :py:mod:`fontTools.t1Lib`: Tools for PostScript Type 1 fonts (Python2 only) 82- :py:mod:`fontTools.ttx`: Module for converting between OTF and XML representation 83- :py:mod:`fontTools.ufoLib`: Module for reading and writing UFO files 84- :py:mod:`fontTools.unicodedata`: Convert between Unicode and OpenType script information 85- :py:mod:`fontTools.varLib`: Module for dealing with 'gvar'-style font variations 86- :py:mod:`fontTools.voltLib`: Module for dealing with Visual OpenType Layout Tool (VOLT) files 87 88A selection of sample Python programs using these libaries can be found in the `Snippets directory <https://github.com/fonttools/fonttools/blob/master/Snippets/>`_ of the fontTools repository. 89 90Optional Dependencies 91--------------------- 92 93The fontTools package currently has no (required) external dependencies 94besides the modules included in the Python Standard Library. 95However, a few extra dependencies are required to unlock optional features 96in some of the library modules. See the :doc:`optional requirements <./optional>` 97page for more information. 98 99Developer information 100--------------------- 101 102Information for developers can be found :doc:`here <./developer>`. 103 104License 105------- 106 107`MIT license <https://github.com/fonttools/fonttools/blob/master/LICENSE>`_. See the full text of the license for details. 108 109 110Table of Contents 111----------------- 112 113.. toctree:: 114 :maxdepth: 2 115 :caption: Library 116 117 afmLib 118 agl 119 cffLib/index 120 colorLib/index 121 cu2qu/index 122 designspaceLib/index 123 encodings/index 124 feaLib/index 125 merge 126 misc/index 127 mtiLib 128 otlLib/index 129 pens/index 130 subset/index 131 svgLib/index 132 t1Lib 133 ttLib/index 134 ttx 135 ufoLib/index 136 unicode 137 unicodedata/index 138 varLib/index 139 voltLib 140 141 142.. |Travis Build Status| image:: https://travis-ci.org/fonttools/fonttools.svg 143 :target: https://travis-ci.org/fonttools/fonttools 144.. |Appveyor Build status| image:: https://ci.appveyor.com/api/projects/status/0f7fmee9as744sl7/branch/master?svg=true 145 :target: https://ci.appveyor.com/project/fonttools/fonttools/branch/master 146.. |Coverage Status| image:: https://codecov.io/gh/fonttools/fonttools/branch/master/graph/badge.svg 147 :target: https://codecov.io/gh/fonttools/fonttools 148.. |PyPI| image:: https://img.shields.io/pypi/v/fonttools.svg 149 :target: https://pypi.org/project/FontTools 150.. |Gitter Chat| image:: https://badges.gitter.im/fonttools-dev/Lobby.svg 151 :alt: Join the chat at https://gitter.im/fonttools-dev/Lobby 152 :target: https://gitter.im/fonttools-dev/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge