Skip to content

Commit

Permalink
Merge pull request #1888 from chrissimpkins/docs-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissimpkins committed Apr 22, 2020
2 parents db1cc24 + 7468572 commit 493581a
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 94 deletions.
1 change: 1 addition & 0 deletions Doc/docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
sphinx == 3.0.2
sphinx_rtd_theme == 0.4.3
reportlab == 3.5.42
200 changes: 122 additions & 78 deletions Doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,12 @@ Please see the :py:mod:`fontTools.ttx` documentation for additional details.
Other Tools
-----------

Commands for inspecting, merging and subsetting fonts are also available::
Commands for merging and subsetting fonts are also available::

pyftinspect
pyftmerge
pyftsubset

Please see the :py:mod:`fontTools.inspect`, :py:mod:`fontTools.merge`, and :py:mod:`fontTools.subset` documentation for additional information about these tools.
Please see the :py:mod:`fontTools.merge` and :py:mod:`fontTools.subset` documentation for additional information about these tools.


fontTools Python Library
Expand All @@ -136,153 +135,177 @@ Please navigate to the respective area of the documentation to learn more about
Optional Requirements
---------------------

.. note::
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 to unlock optional features
in some of the library modules.

Additional dependencies are required by some of the fontTools modules to unlock optional features. The list below details these optional dependencies.
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
inspect Module
^^^^^^^^^^^^^^
pip install fonttools[ufo,lxml,woff,unicode]
:py:mod:`fontTools.inspect`
^^^^^^^^^^^^^^^^^^^^^^^^^^^
This command will install fonttools, as well as the optional dependencies that
are required to unlock the extra features named "ufo", etc.

A GUI font inspector, requires one of the following packages:
Optional dependencies are detailed by module in the list below.

* `PyGTK <https://pypi.python.org/pypi/PyGTK>`_: Python bindings for GTK 2.x (only works with Python 2)
* `PyGObject <https://wiki.gnome.org/action/show/Projects/PyGObject>`_ : Python bindings for GTK 3.x and gobject-introspection libraries (also compatible with Python 3)


:py:mod:`fontTools.misc.etree`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

misc Module
^^^^^^^^^^^
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.

:py:mod:`fontTools.misc.symfont`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Extra:* ``lxml``

Advanced module for symbolic font statistics analysis; it requires:

* `sympy <https://pypi.python.org/pypi/sympy>`_: the Python library for symbolic mathematics
:py:mod:`fontTools.ufoLib`
^^^^^^^^^^^^^^^^^^^^^^^^^^

Package for reading and writing UFO source files; it requires:

* `fs <https://pypi.org/pypi/fs>`__: (aka ``pyfilesystem2``) filesystem
abstraction layer.

pens Modules
^^^^^^^^^^^^
* `enum34 <https://pypi.org/pypi/enum34>`__: backport for the built-in ``enum``
module (only required on Python < 3.4).

:py:mod:`fontTools.pens.cocoaPen`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Extra:* ``ufo``

Pen for drawing glyphs with Cocoa ``NSBezierPath``, requires:

* `PyObjC <https://pypi.python.org/pypi/pyobjc>`_: the bridge between Python and the Objective-C runtime (macOS platform only)
:py:mod:`fontTools.ttLib.woff2`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

:py:mod:`fontTools.pens.qtPen`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* `brotli <https://pypi.python.org/pypi/Brotli>`__: Python bindings of
the Brotli compression library.

Pen for drawing glyphs with Qt's QPainterPath, requires:
*Extra:* ``woff``

* `PyQt5 <https://pypi.python.org/pypi/PyQt5>`_: Python bindings for the Qt cross platform UI and application toolkit

:py:mod:`fontTools.unicode`
^^^^^^^^^^^^^^^^^^^^^^^^^^^

:py:mod:`fontTools.pens.reportLabPen`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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:

Pen to drawing glyphs as PNG images, requires:
* `unicodedata2 <https://pypi.python.org/pypi/unicodedata2>`__:
``unicodedata`` backport for Python 2.7 and 3.x updated to the latest
Unicode version 12.0. Note this is not necessary if you use Python 3.8
as the latter already comes with an up-to-date ``unicodedata``.

* `reportlab <https://pypi.python.org/pypi/reportlab>`_: Python toolkit for generating PDFs and graphics
*Extra:* ``unicode``


:py:mod:`fontTools.varLib.interpolatable`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

t1Lib Module
^^^^^^^^^^^^
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:

:py:mod:`fontTools.t1Lib`
^^^^^^^^^^^^^^^^^^^^^^^^^
* `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.

To get the file creator and type of Apple PostScript Type 1 fonts on Python 3 you need to install the following module, as the old macOS module is no longer included in macOS Python:
*Extra:* ``interpolatable``

* `xattr <https://pypi.python.org/pypi/xattr>`_: Python wrapper for extended filesystem attributes (macOS platform only)

:py:mod:`fontTools.varLib.plot`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Module for visualizing DesignSpaceDocument and resulting VariationModel.

ttLib Modules
^^^^^^^^^^^^^
* `matplotlib <https://pypi.org/pypi/matplotlib>`__: 2D plotting library.

:py:mod:`fontTools.ttLib.woff2`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Extra:* ``plot``

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.
:py:mod:`fontTools.misc.symfont`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Advanced module for symbolic font statistics analysis; it requires:

:py:mod:`fontTools.ttLib.sfnt`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* `sympy <https://pypi.python.org/pypi/sympy>`__: the Python library for
symbolic mathematics.

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

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

:py:mod:`fontTools.t1Lib`
^^^^^^^^^^^^^^^^^^^^^^^^^

ufoLib Module
^^^^^^^^^^^^^
To get the file creator and type of Macintosh PostScript Type 1 fonts
on Python 3 you need to install the following module, as the old ``MacOS``
module is no longer included in Mac Python:

:py:mod:`fontTools.ufoLib`
^^^^^^^^^^^^^^^^^^^^^^^^^^
* `xattr <https://pypi.python.org/pypi/xattr>`__: Python wrapper for
extended filesystem attributes (macOS platform only).

Package for reading and writing UFO source files; it requires:
*Extra:* ``type1``

* `fs <https://pypi.org/pypi/fs>`_: (aka ``pyfilesystem2``) filesystem abstraction layer
* `enum34 <https://pypi.org/pypi/enum34>`_: backport for the built-in enum module (only required on Python < 3.4)

:py:mod:`fontTools.pens.cocoaPen`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

unicode Module
^^^^^^^^^^^^^^
Pen for drawing glyphs with Cocoa ``NSBezierPath``, requires:

* `PyObjC <https://pypi.python.org/pypi/pyobjc>`__: the bridge between
Python and the Objective-C runtime (macOS platform only).

:py:mod:`fontTools.unicode`
^^^^^^^^^^^^^^^^^^^^^^^^^^^

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:
:py:mod:`fontTools.pens.qtPen`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* `unicodedata2 <https://pypi.python.org/pypi/unicodedata2>`_: unicodedata backport for Python 2.7 and 3.5 updated to the latest Unicode version 9.0. Note this is not necessary if you use Python 3.6 as the latter already comes with an up-to-date unicodedata.
Pen for drawing glyphs with Qt's ``QPainterPath``, requires:

* `PyQt5 <https://pypi.python.org/pypi/PyQt5>`__: Python bindings for
the Qt cross platform UI and application toolkit.

varLib Module
^^^^^^^^^^^^^

:py:mod:`fontTools.varLib.interpolatable`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:py:mod:`fontTools.pens.reportLabPen`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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:
Pen to drawing glyphs as PNG images, requires:

* `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
* `reportlab <https://pypi.python.org/pypi/reportlab>`__: Python toolkit
for generating PDFs and graphics.


Testing
-------

To run the test suite, use::

python setup.py test
To run the test suite, you need to install `pytest <http://docs.pytest.org/en/latest/>`__.
When you run the ``pytest`` command, the tests will run against the
installed fontTools package, or the first one found in the
``PYTHONPATH``.

If you have `pytest <http://docs.pytest.org/en/latest/>`_, you can run the pytest command directly. The tests will run against the installed fontTools package, or the first one found in the ``PYTHONPATH``.

You can also use `tox <https://testrun.org/tox/latest/>`_ to automatically run tests on different Python versions in isolated virtual environments::
You can also use `tox <https://tox.readthedocs.io/en/latest/>`__ to
automatically run tests on different Python versions in isolated virtual
environments::

pip install tox
tox



.. note::

When you run ``tox`` without arguments, the tests are executed for all the environments listed in the ``tox.ini`` ``envlist``. The current Python interpreters defined for tox testing must be available on your system ``PATH``.

You can specify a different testing environment list via the ``-e`` option, or the ``TOXENV`` environment variable::

tox -e py27-nocov
tox -e py36
TOXENV="py36-cov,htmlcov" tox


Expand All @@ -296,13 +319,34 @@ Feature requests and bug reports are always welcome at https://github.com/fontto
The best place for end-user and developer discussion about the fontTools project is the `fontTools gitter channel <https://gitter.im/fonttools-dev/Lobby>`_. There is also a development https://groups.google.com/d/forum/fonttools-dev mailing list for continuous integration notifications.


History
-------

The fontTools project was started by Just van Rossum in 1999, and was
maintained as an open source project at
http://sourceforge.net/projects/fonttools/. In 2008, Paul Wise (pabs3)
began helping Just with stability maintenance. In 2013 Behdad Esfahbod
began a friendly fork, thoroughly reviewing the codebase and making
changes at https://github.com/behdad/fonttools to add new features and
support for new font formats.


Acknowledgments
---------------

In alphabetical order:

Olivier Berten, Samyak Bhuta, Erik van Blokland, Petr van Blokland, Jelle Bosma, Sascha Brawer, Tom Byrer, Frédéric Coiffier, Vincent Connare, Dave Crossland, Simon Daniels, Behdad Esfahbod, Behnam Esfahbod, Hannes Famira, Sam Fishman, Matt Fontaine, Yannis Haralambous, Greg Hitchcock, Jeremie Hornus, Khaled Hosny, John Hudson, Denis Moyogo Jacquerye, Jack Jansen, Tom Kacvinsky, Jens Kutilek, Antoine Leca, Werner Lemberg, Tal Leming, Peter Lofting, Cosimo Lupo, Masaya Nakamura, Dave Opstad, Laurence Penney, Roozbeh Pournader, Garret Rieger, Read Roberts, Guido van Rossum, Just van Rossum, Andreas Seidel, Georg Seifert, Miguel Sousa, Adam Twardoch, Adrien Tétar, Vitaly Volkov, Paul Wise

Olivier Berten, Samyak Bhuta, Erik van Blokland, Petr van Blokland,
Jelle Bosma, Sascha Brawer, Tom Byrer, Frédéric Coiffier, Vincent
Connare, Dave Crossland, Simon Daniels, Peter Dekkers, Behdad Esfahbod,
Behnam Esfahbod, Hannes Famira, Sam Fishman, Matt Fontaine, Yannis
Haralambous, Greg Hitchcock, Jeremie Hornus, Khaled Hosny, John Hudson,
Denis Moyogo Jacquerye, Jack Jansen, Tom Kacvinsky, Jens Kutilek,
Antoine Leca, Werner Lemberg, Tal Leming, Peter Lofting, Cosimo Lupo,
Masaya Nakamura, Dave Opstad, Laurence Penney, Roozbeh Pournader, Garret
Rieger, Read Roberts, Guido van Rossum, Just van Rossum, Andreas Seidel,
Georg Seifert, Chris Simpkins, Miguel Sousa, Adam Twardoch, Adrien Tétar, Vitaly Volkov,
Paul Wise.

License
-------
Expand Down
8 changes: 8 additions & 0 deletions Doc/source/misc/etree.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#####
etree
#####

.. automodule:: fontTools.misc.etree
:inherited-members:
:members:
:undoc-members:
4 changes: 3 additions & 1 deletion Doc/source/misc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ misc
cliTools
eexec
encodingTools
etree
filenames
fixedTools
intTools
loggingTools
macCreatorType
macRes
loggingTools
psCharStrings
psLib
psOperators
Expand Down
8 changes: 8 additions & 0 deletions Doc/source/misc/intTools.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
########
intTools
########

.. automodule:: fontTools.misc.intTools
:inherited-members:
:members:
:undoc-members:
1 change: 1 addition & 0 deletions Doc/source/pens/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pens
pointPen
qtPen
recordingPen
reportLabPen
reverseContourPen
roundingPen
statisticsPen
Expand Down
8 changes: 8 additions & 0 deletions Doc/source/pens/reportLabPen.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
############
reportLabPen
############

.. automodule:: fontTools.pens.reportLabPen
:inherited-members:
:members:
:undoc-members:

0 comments on commit 493581a

Please sign in to comment.