aboutsummaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/README.md121
-rw-r--r--Doc/docs-requirements.txt3
-rw-r--r--Doc/source/afmLib.rst9
-rw-r--r--Doc/source/agl.rst9
-rwxr-xr-xDoc/source/assets/img/favicon.icobin0 -> 15406 bytes
-rw-r--r--Doc/source/cffLib.rst7
-rw-r--r--Doc/source/cffLib/index.rst53
-rw-r--r--Doc/source/cffLib/specializer.rst8
-rw-r--r--Doc/source/cffLib/width.rst6
-rw-r--r--Doc/source/colorLib/index.rst11
-rw-r--r--Doc/source/conf.py73
-rw-r--r--Doc/source/cu2qu/index.rst38
-rw-r--r--Doc/source/designspaceLib/index.rst1
-rw-r--r--Doc/source/designspaceLib/readme.rst313
-rw-r--r--Doc/source/developer.rst115
-rw-r--r--Doc/source/encodings.rst14
-rw-r--r--Doc/source/encodings/index.rst21
-rw-r--r--Doc/source/feaLib.rst43
-rw-r--r--Doc/source/feaLib/index.rst40
-rw-r--r--Doc/source/index.rst144
-rw-r--r--Doc/source/merge.rst13
-rw-r--r--Doc/source/misc/arrayTools.rst8
-rw-r--r--Doc/source/misc/bezierTools.rst7
-rw-r--r--Doc/source/misc/classifyTools.rst1
-rw-r--r--Doc/source/misc/cliTools.rst8
-rw-r--r--Doc/source/misc/eexec.rst7
-rw-r--r--Doc/source/misc/encodingTools.rst1
-rw-r--r--Doc/source/misc/etree.rst8
-rw-r--r--Doc/source/misc/filenames.rst7
-rw-r--r--Doc/source/misc/fixedTools.rst7
-rw-r--r--Doc/source/misc/index.rst23
-rw-r--r--Doc/source/misc/intTools.rst6
-rw-r--r--Doc/source/misc/loggingTools.rst6
-rw-r--r--Doc/source/misc/macCreatorType.rst9
-rw-r--r--Doc/source/misc/macRes.rst11
-rw-r--r--Doc/source/misc/plistlib.rst9
-rw-r--r--Doc/source/misc/psCharStrings.rst1
-rw-r--r--Doc/source/misc/psLib.rst8
-rw-r--r--Doc/source/misc/psOperators.rst8
-rw-r--r--Doc/source/misc/py23.rst8
-rw-r--r--Doc/source/misc/sstruct.rst1
-rw-r--r--Doc/source/misc/symfont.rst8
-rw-r--r--Doc/source/misc/testTools.rst1
-rw-r--r--Doc/source/misc/textTools.rst1
-rw-r--r--Doc/source/misc/timeTools.rst1
-rw-r--r--Doc/source/misc/transform.rst1
-rw-r--r--Doc/source/misc/xmlReader.rst1
-rw-r--r--Doc/source/misc/xmlWriter.rst1
-rw-r--r--Doc/source/mtiLib.rst14
-rw-r--r--Doc/source/optional.rst140
-rw-r--r--Doc/source/otlLib/index.rst74
-rw-r--r--Doc/source/pens/areaPen.rst1
-rw-r--r--Doc/source/pens/basePen.rst1
-rw-r--r--Doc/source/pens/boundsPen.rst1
-rw-r--r--Doc/source/pens/cocoaPen.rst8
-rw-r--r--Doc/source/pens/cu2quPen.rst8
-rw-r--r--Doc/source/pens/filterPen.rst1
-rw-r--r--Doc/source/pens/index.rst24
-rw-r--r--Doc/source/pens/momentsPen.rst8
-rw-r--r--Doc/source/pens/perimeterPen.rst1
-rw-r--r--Doc/source/pens/pointInsidePen.rst1
-rw-r--r--Doc/source/pens/pointPen.rst8
-rw-r--r--Doc/source/pens/qtPen.rst8
-rw-r--r--Doc/source/pens/recordingPen.rst1
-rw-r--r--Doc/source/pens/reportLabPen.rst8
-rw-r--r--Doc/source/pens/reverseContourPen.rst8
-rw-r--r--Doc/source/pens/roundingPen.rst8
-rw-r--r--Doc/source/pens/statisticsPen.rst1
-rw-r--r--Doc/source/pens/svgPathPen.rst8
-rw-r--r--Doc/source/pens/t2CharStringPen.rst1
-rw-r--r--Doc/source/pens/teePen.rst1
-rw-r--r--Doc/source/pens/transformPen.rst1
-rw-r--r--Doc/source/pens/ttGlyphPen.rst8
-rw-r--r--Doc/source/pens/wxPen.rst8
-rw-r--r--Doc/source/subset/cff.rst8
-rw-r--r--Doc/source/subset/index.rst (renamed from Doc/source/subset.rst)6
-rw-r--r--Doc/source/svgLib/index.rst8
-rw-r--r--Doc/source/svgLib/path/index.rst13
-rw-r--r--Doc/source/svgLib/path/parser.rst8
-rw-r--r--Doc/source/t1Lib.rst1
-rw-r--r--Doc/source/ttLib/index.rst4
-rw-r--r--Doc/source/ttLib/macUtils.rst1
-rw-r--r--Doc/source/ttLib/sfnt.rst1
-rw-r--r--Doc/source/ttLib/standardGlyphOrder.rst12
-rw-r--r--Doc/source/ttLib/tables.rst359
-rw-r--r--Doc/source/ttLib/ttCollection.rst8
-rw-r--r--Doc/source/ttLib/ttFont.rst9
-rw-r--r--Doc/source/ttLib/woff2.rst1
-rw-r--r--Doc/source/ttx.rst55
-rw-r--r--Doc/source/ufoLib/converters.rst8
-rw-r--r--Doc/source/ufoLib/errors.rst9
-rw-r--r--Doc/source/ufoLib/filenames.rst8
-rw-r--r--Doc/source/ufoLib/glifLib.rst8
-rw-r--r--Doc/source/ufoLib/index.rst22
-rw-r--r--Doc/source/ufoLib/kerning.rst9
-rw-r--r--Doc/source/ufoLib/plistlib.rst9
-rw-r--r--Doc/source/ufoLib/pointPen.rst9
-rw-r--r--Doc/source/ufoLib/pointpen.rst9
-rw-r--r--Doc/source/ufoLib/ufoLib.rst9
-rw-r--r--Doc/source/ufoLib/utils.rst9
-rw-r--r--Doc/source/ufoLib/validators.rst9
-rw-r--r--Doc/source/unicode.rst8
-rw-r--r--Doc/source/unicodedata/Blocks.rst13
-rw-r--r--Doc/source/unicodedata/OTTags.rst17
-rw-r--r--Doc/source/unicodedata/ScriptExtensions.rst12
-rw-r--r--Doc/source/unicodedata/Scripts.rst16
-rw-r--r--Doc/source/unicodedata/index.rst16
-rw-r--r--Doc/source/varLib/builder.rst8
-rw-r--r--Doc/source/varLib/cff.rst8
-rw-r--r--Doc/source/varLib/designspace.rst7
-rw-r--r--Doc/source/varLib/errors.rst8
-rw-r--r--Doc/source/varLib/featureVars.rst8
-rw-r--r--Doc/source/varLib/index.rst105
-rw-r--r--Doc/source/varLib/instancer.rst8
-rw-r--r--Doc/source/varLib/interpolatable.rst1
-rw-r--r--Doc/source/varLib/interpolate_layout.rst1
-rw-r--r--Doc/source/varLib/iup.rst8
-rw-r--r--Doc/source/varLib/merger.rst1
-rw-r--r--Doc/source/varLib/models.rst1
-rw-r--r--Doc/source/varLib/mutator.rst1
-rw-r--r--Doc/source/varLib/mvar.rst10
-rw-r--r--Doc/source/varLib/plot.rst8
-rw-r--r--Doc/source/varLib/varStore.rst8
-rw-r--r--Doc/source/voltLib.rst5
124 files changed, 2141 insertions, 300 deletions
diff --git a/Doc/README.md b/Doc/README.md
new file mode 100644
index 00000000..26641b72
--- /dev/null
+++ b/Doc/README.md
@@ -0,0 +1,121 @@
+# fontTools Documentation
+
+The fontTools project documentation updates continuously on Read the Docs as the project source changes.
+
+The documentation is hosted at https://fonttools.readthedocs.io/.
+
+## Contents
+
+- [How to Build Local Documentation](#how-to-build-local-documentation)
+- [Contributing to the fontTools Documentation](#contributing-to-the-documentation)
+- [Documentation License](#documentation-license)
+
+## How to Build Local Documentation
+
+### Install Dependencies
+
+You must have a Python 3 interpreter and the `pip` Python package manager installed on your system to build the fontTools documentation.
+
+Pull the fontTools project source files, create a Python virtual environment, and then install fontTools and the documentation build dependencies by executing the following commands in the root of the fontTools source repository:
+
+```
+$ pip install -e . [all]
+$ pip install -r Doc/docs-requirements.txt
+```
+
+### Build Documentation
+
+**With `make`**: execute the following command in the root of the repository:
+
+```
+$ make docs
+```
+
+**Without `make`**: execute the following command in the **`Doc` directory**:
+
+```
+$ sphinx-build -b html source build
+```
+
+Open the `Doc/build/html/index.html` file in your browser to view the documentation home page.
+
+## Contributing to the Documentation
+
+We highly encourage contributions! Please follow the instructions below to improve the documentation.
+
+### Python Docstring Style
+
+We recommend the use of Python docstrings that follow [the Google Style Guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md#381-docstrings). Our documentation build approach parses appropriately formatted docstrings into formatted documentation files.
+
+#### Function Documentation Example
+
+```python
+def fetch_bigtable_rows(big_table, keys, other_silly_variable=None):
+ """Fetches rows from a Bigtable.
+
+ Retrieves rows pertaining to the given keys from the Table instance
+ represented by big_table. Silly things may happen if
+ other_silly_variable is not None.
+
+ Args:
+ big_table: An open Bigtable Table instance.
+ keys: A sequence of strings representing the key of each table row
+ to fetch.
+ other_silly_variable: Another optional variable, that has a much
+ longer name than the other args, and which does nothing.
+
+ Returns:
+ A dict mapping keys to the corresponding table row data
+ fetched. Each row is represented as a tuple of strings. For
+ example:
+
+ {'Serak': ('Rigel VII', 'Preparer'),
+ 'Zim': ('Irk', 'Invader'),
+ 'Lrrr': ('Omicron Persei 8', 'Emperor')}
+
+ If a key from the keys argument is missing from the dictionary,
+ then that row was not found in the table.
+
+ Raises:
+ IOError: An error occurred accessing the bigtable.Table object.
+ """
+```
+*Source: [Google Style Guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md) (CC BY-SA 3.0)*
+
+#### Class Documentation Example
+
+```python
+class SampleClass(object):
+ """Summary of class here.
+
+ Longer class information....
+ Longer class information....
+
+ Attributes:
+ likes_spam: A boolean indicating if we like SPAM or not.
+ eggs: An integer count of the eggs we have laid.
+ """
+
+ def __init__(self, likes_spam=False):
+ """Inits SampleClass with blah."""
+ self.likes_spam = likes_spam
+ self.eggs = 0
+
+ def public_method(self):
+ """Performs operation blah."""
+```
+*Source: [Google Style Guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md) (CC BY-SA 3.0)*
+
+### Build Local Documentation and Review Your Changes
+
+Build a local set of HTML documentation files with the instructions above and review your changes.
+
+### Submit a Pull Request
+
+Submit a Github pull request with your proposed improvements to the documentation.
+
+Thanks for your contribution!
+
+## Documentation License
+
+The fontTools documentation is released under a [CC BY-SA 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).
diff --git a/Doc/docs-requirements.txt b/Doc/docs-requirements.txt
new file mode 100644
index 00000000..c62c8d1e
--- /dev/null
+++ b/Doc/docs-requirements.txt
@@ -0,0 +1,3 @@
+sphinx==3.3.1
+sphinx_rtd_theme==0.5.0
+reportlab==3.5.55
diff --git a/Doc/source/afmLib.rst b/Doc/source/afmLib.rst
index f56d3c1b..ab9f3567 100644
--- a/Doc/source/afmLib.rst
+++ b/Doc/source/afmLib.rst
@@ -1,7 +1,8 @@
-######
-afmLib
-######
+###########################################
+afmLib: Read/write Adobe Font Metrics files
+###########################################
.. automodule:: fontTools.afmLib
+
+.. autoclass:: fontTools.afmLib.AFM
:members:
- :undoc-members:
diff --git a/Doc/source/agl.rst b/Doc/source/agl.rst
index 0ecf14d0..6e89857f 100644
--- a/Doc/source/agl.rst
+++ b/Doc/source/agl.rst
@@ -1,7 +1,6 @@
-###
-agl
-###
+######################################
+agl: Interface to the Adobe Glyph List
+######################################
.. automodule:: fontTools.agl
- :members:
- :undoc-members:
+ :members: toUnicode, UV2AGL, AGL2UV
diff --git a/Doc/source/assets/img/favicon.ico b/Doc/source/assets/img/favicon.ico
new file mode 100755
index 00000000..f55a275d
--- /dev/null
+++ b/Doc/source/assets/img/favicon.ico
Binary files differ
diff --git a/Doc/source/cffLib.rst b/Doc/source/cffLib.rst
deleted file mode 100644
index 364824f4..00000000
--- a/Doc/source/cffLib.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-######
-cffLib
-######
-
-.. automodule:: fontTools.cffLib
- :members:
- :undoc-members:
diff --git a/Doc/source/cffLib/index.rst b/Doc/source/cffLib/index.rst
new file mode 100644
index 00000000..281a0b12
--- /dev/null
+++ b/Doc/source/cffLib/index.rst
@@ -0,0 +1,53 @@
+##################################
+cffLib: read/write Adobe CFF fonts
+##################################
+
+.. automodule:: fontTools.cffLib
+
+This package also contains two modules for manipulating CFF format glyphs:
+
+.. toctree::
+ :maxdepth: 1
+
+ specializer
+ width
+
+.. autoclass:: fontTools.cffLib.CFFFontSet
+ :inherited-members:
+ :members:
+
+.. autoclass:: fontTools.cffLib.TopDict
+ :members:
+
+.. autoclass:: fontTools.cffLib.CharStrings
+ :members:
+
+.. autoclass:: fontTools.cffLib.Index
+ :members:
+
+.. autoclass:: fontTools.cffLib.GlobalSubrsIndex
+ :members:
+
+.. autoclass:: fontTools.cffLib.TopDictIndex
+ :members:
+
+.. autoclass:: fontTools.cffLib.CFFWriter
+ :members:
+
+.. autoclass:: fontTools.cffLib.IndexCompiler
+ :members:
+
+.. autoclass:: fontTools.cffLib.TopDictIndexCompiler
+ :members:
+
+.. autoclass:: fontTools.cffLib.FDArrayIndexCompiler
+ :members:
+
+.. autoclass:: fontTools.cffLib.GlobalSubrsCompiler
+ :members:
+
+.. autoclass:: fontTools.cffLib.SubrsCompiler
+ :members:
+
+.. autoclass:: fontTools.cffLib.CharStringsCompiler
+ :members:
diff --git a/Doc/source/cffLib/specializer.rst b/Doc/source/cffLib/specializer.rst
new file mode 100644
index 00000000..016a8962
--- /dev/null
+++ b/Doc/source/cffLib/specializer.rst
@@ -0,0 +1,8 @@
+##############################################################
+specializer: T2CharString operator specializer and generalizer
+##############################################################
+
+.. automodule:: fontTools.cffLib.specializer
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/cffLib/width.rst b/Doc/source/cffLib/width.rst
new file mode 100644
index 00000000..68944da8
--- /dev/null
+++ b/Doc/source/cffLib/width.rst
@@ -0,0 +1,6 @@
+#########################################
+width: T2CharString glyph width optimizer
+#########################################
+
+.. automodule:: fontTools.cffLib.width
+ :members: optimizeWidths, optimizeWidthsBruteforce
diff --git a/Doc/source/colorLib/index.rst b/Doc/source/colorLib/index.rst
new file mode 100644
index 00000000..d4eb9f83
--- /dev/null
+++ b/Doc/source/colorLib/index.rst
@@ -0,0 +1,11 @@
+#####################################################
+colorLib.builder: Build COLR/CPAL tables from scratch
+#####################################################
+
+.. automodule:: fontTools.colorLib.builder
+ :members: buildCPAL, buildCOLR, populateCOLRv0
+
+.. autoclass:: fontTools.colorLib.builder.ColorPaletteType
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/conf.py b/Doc/source/conf.py
index a3b2be2a..82a5d579 100644
--- a/Doc/source/conf.py
+++ b/Doc/source/conf.py
@@ -25,40 +25,43 @@
# If your documentation needs a minimal Sphinx version, state it here.
#
-needs_sphinx = '1.3'
+needs_sphinx = "1.3"
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
+extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.napoleon", "sphinx.ext.coverage"]
-autodoc_mock_imports = ['gtk']
+autodoc_mock_imports = ["gtk"]
# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
+templates_path = ["_templates"]
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
-source_suffix = '.rst'
+source_suffix = ".rst"
# The master toctree document.
-master_doc = 'index'
+master_doc = "index"
# General information about the project.
-project = u'fontTools'
-copyright = u'2017, Just van Rossum, Behdad Esfahbod et al.'
-author = u'Just van Rossum, Behdad Esfahbod et al.'
+project = u"fontTools"
+copyright = u"2020, Just van Rossum, Behdad Esfahbod, and the fontTools Authors. CC BY-SA 4.0"
+author = u"Just van Rossum, Behdad Esfahbod, and the fontTools Authors"
+
+# HTML page title
+html_title = "fontTools Documentation"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = u'3.10'
+version = u"4.0"
# The full version, including alpha/beta/rc tags.
-release = u'3.10'
+release = u"4.0"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -73,10 +76,11 @@ language = None
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
+# pygments_style = "sphinx" (the default sphinx docs style on RTD)
+pygments_style = "default"
# If true, `todo` and `todoList` produce output, else they produce nothing.
-todo_include_todos = False
+todo_include_todos = True
# -- Options for HTML output ----------------------------------------------
@@ -84,24 +88,29 @@ todo_include_todos = False
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
-html_theme = 'classic'
+html_theme = "sphinx_rtd_theme"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
-# html_theme_options = {}
+html_theme_options = {"display_version": False}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+html_static_path = ["_static"]
+
+html_favicon = "assets/img/favicon.ico"
+
+# display the Sphinx attribution in the footer
+html_show_sphinx = False
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
-htmlhelp_basename = 'fontToolsDoc'
+htmlhelp_basename = "fontToolsDoc"
# -- Options for LaTeX output ---------------------------------------------
@@ -110,15 +119,12 @@ latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
-
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
-
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
-
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
@@ -128,8 +134,13 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- (master_doc, 'fontTools.tex', u'fontTools Documentation',
- u'Just van Rossum, Behdad Esfahbod et al.', 'manual'),
+ (
+ master_doc,
+ "fontTools.tex",
+ u"fontTools Documentation",
+ u"Just van Rossum, Behdad Esfahbod et al.",
+ "manual",
+ )
]
@@ -137,10 +148,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
-man_pages = [
- (master_doc, 'fonttools', u'fontTools Documentation',
- [author], 1)
-]
+man_pages = [(master_doc, "fonttools", u"fontTools Documentation", [author], 1)]
# -- Options for Texinfo output -------------------------------------------
@@ -149,8 +157,13 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- (master_doc, 'fontTools', u'fontTools Documentation',
- author, 'fontTools', 'A library for manipulating fonts, written in Python.',
- 'Typography'),
+ (
+ master_doc,
+ "fontTools",
+ u"fontTools Documentation",
+ author,
+ "fontTools",
+ "A library for manipulating fonts, written in Python.",
+ "Typography",
+ )
]
-
diff --git a/Doc/source/cu2qu/index.rst b/Doc/source/cu2qu/index.rst
new file mode 100644
index 00000000..41730e54
--- /dev/null
+++ b/Doc/source/cu2qu/index.rst
@@ -0,0 +1,38 @@
+##########################################
+cu2qu: Cubic to quadratic curve conversion
+##########################################
+
+Routines for converting cubic curves to quadratic splines, suitable for use
+in OpenType to TrueType outline conversion.
+
+Conversion is carried out to a degree of tolerance provided by the user. While
+it is relatively easy to find the best *single* quadratic curve to represent a
+given cubic (see for example `this method from CAGD <https://www.sirver.net/blog/2011/08/23/degree-reduction-of-bezier-curves/>`_),
+the best-fit method may not be sufficiently accurate for type design.
+
+Instead, this method chops the cubic curve into multiple segments before
+converting each cubic segment to a quadratic, in order to ensure that the
+resulting spline fits within the given tolerance.
+
+The basic curve conversion routines are implemented in the
+:mod:`fontTools.cu2qu.cu2qu` module; the :mod:`fontTools.cu2qu.ufo` module
+applies these routines to all of the curves in a UFO file or files; while the
+:mod:`fontTools.cu2qu.cli` module implements the ``fonttools cu2qu`` command
+for converting a UFO format font with cubic curves into one with quadratic
+curves.
+
+fontTools.cu2qu.cu2qu
+---------------------
+
+.. automodule:: fontTools.cu2qu.cu2qu
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+fontTools.cu2qu.ufo
+-------------------
+
+.. automodule:: fontTools.cu2qu.ufo
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/designspaceLib/index.rst b/Doc/source/designspaceLib/index.rst
index 2fb4e528..2c33df7b 100644
--- a/Doc/source/designspaceLib/index.rst
+++ b/Doc/source/designspaceLib/index.rst
@@ -13,5 +13,6 @@ to have a reader and writer that are independent of a specific system.
scripting
.. automodule:: fontTools.designspaceLib
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/designspaceLib/readme.rst b/Doc/source/designspaceLib/readme.rst
index 2594084a..c5757a6e 100644
--- a/Doc/source/designspaceLib/readme.rst
+++ b/Doc/source/designspaceLib/readme.rst
@@ -2,23 +2,22 @@
DesignSpaceDocument Specification
#################################
-An object to read, write and edit interpolation systems for typefaces.
+An object to read, write and edit interpolation systems for typefaces. Define sources, axes, rules and instances.
-- the format was originally written for MutatorMath.
-- the format is now also used in fontTools.varlib.
-- Define sources, axes and instances.
-- Not all values might be required by all applications.
+- `The Python API of the objects <#python-api>`_
+- `The document XML structure <#document-xml-structure>`_
-A couple of differences between things that use designspaces:
-- Varlib does not support anisotropic interpolations.
-- MutatorMath and Superpolator will extrapolate over the boundaries of
- the axes. Varlib can not (at the moment).
-- Varlib requires much less data to define an instance than
- MutatorMath.
-- The goals of Varlib and MutatorMath are different, so not all
- attributes are always needed.
-- Need to expand the description of FDK use of designspace files.
+**********
+Python API
+**********
+
+
+
+.. _designspacedocument-object:
+
+DesignSpaceDocument object
+==========================
The DesignSpaceDocument object can read and write ``.designspace`` data.
It imports the axes, sources and instances to very basic **descriptor**
@@ -28,87 +27,75 @@ adding them to the document. This makes it easy to integrate this object
in different contexts.
The **DesignSpaceDocument** object can be subclassed to work with
-different objects, as long as they have the same attributes.
+different objects, as long as they have the same attributes. Reader and
+Writer objects can be subclassed as well.
+
+**Note:** Python attribute names are usually camelCased, the
+corresponding `XML <#document-xml-structure>`_ attributes are usually
+all lowercase.
+
+.. example-1:
.. code:: python
- from designSpaceDocument import DesignSpaceDocument
+ from fontTools.designspaceLib import DesignSpaceDocument
doc = DesignSpaceDocument()
doc.read("some/path/to/my.designspace")
doc.axes
doc.sources
doc.instances
-**********
-Validation
-**********
+Attributes
+----------
-Some validation is done when reading.
-
-Axes
-====
-
-- If the ``axes`` element is available in the document then all
- locations will check their dimensions against the defined axes. If a
- location uses an axis that is not defined it will be ignored.
-- If there are no ``axes`` in the document, locations will accept all
- axis names, so that we can..
-- Use ``doc.checkAxes()`` to reconstruct axes definitions based on the
- ``source.location`` values. If you save the document the axes will be
- there.
-
-Default font
-============
-
-- The source with the ``copyInfo`` flag indicates this is the default
- font.
-- In mutatorMath the default font is selected automatically. A warning
- is printed if the mutatorMath default selection differs from the one
- set by ``copyInfo``. But the ``copyInfo`` source will be used.
-- If no source has a ``copyInfo`` flag, mutatorMath will be used to
- select one. This source gets its ``copyInfo`` flag set. If you save
- the document this flag will be set.
-- Use ``doc.checkDefault()`` to set the default font.
-
-************
-Localisation
-************
-
-Some of the descriptors support localised names. The names are stored in
-dictionaries using the language code as key. That means that there are
-now two places to store names: the old attribute and the new localised
-dictionary, ``obj.stylename`` and ``obj.localisedStyleName['en']``.
-
-*****
-Rules
-*****
+- ``axes``: list of axisDescriptors
+- ``sources``: list of sourceDescriptors
+- ``instances``: list of instanceDescriptors
+- ``rules``: list if ruleDescriptors
+- ``readerClass``: class of the reader object
+- ``writerClass``: class of the writer object
+- ``lib``: dict for user defined, custom data that needs to be stored
+ in the designspace. Use reverse-DNS notation to identify your own data.
+ Respect the data stored by others.
+- ``rulesProcessingLast``: This flag indicates whether the substitution rules should be applied before or after other glyph substitution features. False: before, True: after.
+
+Methods
+-------
+
+- ``read(path)``: read a designspace file from ``path``
+- ``write(path)``: write this designspace to ``path``
+- ``addSource(aSourceDescriptor)``: add this sourceDescriptor to
+ ``doc.sources``.
+- ``addInstance(anInstanceDescriptor)``: add this instanceDescriptor
+ to ``doc.instances``.
+- ``addAxis(anAxisDescriptor)``: add this instanceDescriptor to ``doc.axes``.
+- ``newDefaultLocation()``: returns a dict with the default location
+ in designspace coordinates.
+- ``updateFilenameFromPath(masters=True, instances=True, force=False)``:
+ set a descriptor filename attr from the path and this document.
+- ``newAxisDescriptor()``: return a new axisDescriptor object.
+- ``newSourceDescriptor()``: return a new sourceDescriptor object.
+- ``newInstanceDescriptor()``: return a new instanceDescriptor object.
+- ``getAxisOrder()``: return a list of axisnames
+- ``findDefault()``: return the sourceDescriptor that is on the default
+ location. Returns None if there isn't one.
+- ``normalizeLocation(aLocation)``: return a dict with normalized axis values.
+- ``normalize()``: normalize the geometry of this designspace: scale all the
+ locations of all masters and instances to the ``-1 - 0 - 1`` value.
+- ``loadSourceFonts()``: Ensure SourceDescriptor.font attributes are loaded,
+ and return list of fonts.
+- ``tostring(encoding=None)``: Returns the designspace as a string. Default
+ encoding `utf-8`.
+
+Class Methods
+-------------
+- ``fromfile(path)``
+- ``fromstring(string)``
-Rules describe designspace areas in which one glyph should be replaced by another.
-A rule has a name and a number of conditionsets. The rule also contains a list of
-glyphname pairs: the glyphs that need to be substituted. For a rule to be triggered
-**only one** of the conditionsets needs to be true, ``OR``. Within a conditionset
-**all** conditions need to be true, ``AND``.
-The ``sub`` element contains a pair of glyphnames. The ``name`` attribute is the glyph that should be visible when the rule evaluates to **False**. The ``with`` attribute is the glyph that should be visible when the rule evaluates to **True**.
-UFO instances
-=============
-- When making instances as UFOs however, we need to swap the glyphs so
- that the original shape is still available. For instance, if a rule
- swaps ``a`` for ``a.alt``, but a glyph that references ``a`` in a
- component would then show the new ``a.alt``.
-- But that can lead to unexpected results. So, if there are no rules
- for ``adieresis`` (assuming it references ``a``) then that glyph
- **should not change appearance**. That means that when the rule swaps
- ``a`` and ``a.alt`` it also swaps all components that reference these
- glyphs so they keep their appearance.
-- The swap function also needs to take care of swapping the names in
- kerning data.
-**********
-Python API
-**********
SourceDescriptor object
=======================
@@ -138,8 +125,7 @@ Attributes
- ``copyLib``: bool. Indicates if the contents of the font.lib need to
be copied to the instances. MutatorMath.
- ``copyInfo`` bool. Indicates if the non-interpolating font.info needs
- to be copied to the instances. Also indicates this source is expected
- to be the default font. MutatorMath + Varlib
+ to be copied to the instances. MutatorMath
- ``copyGroups`` bool. Indicates if the groups need to be copied to the
instances. MutatorMath.
- ``copyFeatures`` bool. Indicates if the feature text needs to be
@@ -182,6 +168,7 @@ InstanceDescriptor object
.. attributes-1:
+
Attributes
----------
@@ -284,10 +271,9 @@ AxisDescriptor object
- ``default``: number. The default value for this axis, i.e. when a new
location is created, this is the value this axis will get in user
space. MutatorMath + Varlib.
-- ``map``: list of input / output values that can describe a warp of user space
- to design space coordinates. If no map values are present, it is assumed user
- space is the same as design space, as in [(minimum, minimum), (maximum, maximum)].
- Varlib.
+- ``map``: list of input / output values that can describe a warp
+ of user space to design space coordinates. If no map values are present, it is assumed user space is the same as design space, as
+ in [(minimum, minimum), (maximum, maximum)]. Varlib.
.. code:: python
@@ -311,15 +297,27 @@ RuleDescriptor object
- Each condition is a dict with ``name``, ``minimum`` and ``maximum`` keys.
- ``subs``: list of substitutions
- Each substitution is stored as tuples of glyphnames, e.g. ("a", "a.alt").
+- Note: By default, rules are applied first, before other text shaping/OpenType layout, as they are part of the `Required Variation Alternates OpenType feature <https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#-tag-rvrn>`_. See `5.0 rules element`_ § Attributes.
+
+Evaluating rules
+----------------
+
+- ``evaluateRule(rule, location)``: Return True if any of the rule's conditionsets
+ matches the given location.
+- ``evaluateConditions(conditions, location)``: Return True if all the conditions
+ matches the given location.
+- ``processRules(rules, location, glyphNames)``: Apply all the rules to the list
+ of glyphNames. Return a new list of glyphNames with substitutions applied.
.. code:: python
r1 = RuleDescriptor()
r1.name = "unique.rule.name"
- r1.conditionsSets.append([dict(name="weight", minimum=-10, maximum=10), dict(...)])
- r1.conditionsSets.append([dict(...), dict(...)])
+ r1.conditionSets.append([dict(name="weight", minimum=-10, maximum=10), dict(...)])
+ r1.conditionSets.append([dict(...), dict(...)])
r1.subs.append(("a", "a.alt"))
+
.. _subclassing-descriptors:
Subclassing descriptors
@@ -400,9 +398,9 @@ Attributes
location elements.
- ``tag``: required, string, 4 letters. Some axis tags are registered
in the OpenType Specification.
-- ``minimum``: required, number. The minimum value for this axis.
-- ``maximum``: required, number. The maximum value for this axis.
-- ``default``: required, number. The default value for this axis.
+- ``minimum``: required, number. The minimum value for this axis, in user space coordinates.
+- ``maximum``: required, number. The maximum value for this axis, in user space coordinates.
+- ``default``: required, number. The default value for this axis, in user space coordinates.
- ``hidden``: optional, 0 or 1. Records whether this axis needs to be
hidden in interfaces.
@@ -433,7 +431,7 @@ Value
- The natural language name of this axis.
-.. example-1:
+.. example-2:
Example
-------
@@ -448,12 +446,12 @@ Example
1.2 map element
===============
-- Defines a single node in a series of input value / output value
- pairs.
+- Defines a single node in a series of input value (user space coordinate)
+ to output value (designspace coordinate) pairs.
- Together these values transform the designspace.
- Child of ``axis`` element.
-.. example-2:
+.. example-3:
Example
-------
@@ -507,7 +505,7 @@ Attributes
- ``yvalue``: optional, number. Separate value for anisotropic
interpolations.
-.. example-3:
+.. example-4:
Example
-------
@@ -524,8 +522,9 @@ Example
3. source element
=================
-- Defines a single font that contributes to the designspace.
+- Defines a single font or layer that contributes to the designspace.
- Child element of ``sources``
+- Location in designspace coordinates.
.. attributes-5:
@@ -584,9 +583,7 @@ There are two meanings for the ``lib`` element:
- Child element of ``source``
- Defines if the instances can inherit the non-interpolating font info
from this source.
-- MutatorMath + Varlib
-- NOTE: **This presence of this element indicates this source is to be
- the default font.**
+- MutatorMath
.. 33-features-element:
@@ -638,7 +635,7 @@ Attributes
include the kerning of this source in the calculation.
- MutatorMath only
-.. example-4:
+.. example-5:
Example
-------
@@ -669,6 +666,7 @@ Example
- MutatorMath uses the ``glyphs`` element to describe how certain
glyphs need different masters, mainly to describe the effects of
conditional rules in Superpolator.
+- Location in designspace coordinates.
.. attributes-8:
@@ -774,7 +772,7 @@ with an ``xml:lang`` attribute:
- stylemapstylename
- stylemapfamilyname
-.. example-5:
+.. example-6:
Example
-------
@@ -798,7 +796,7 @@ Attributes
- ``source``: the identifier name of the source this master glyph needs
to be loaded from
-.. example-6:
+.. example-7:
Example
-------
@@ -846,6 +844,21 @@ Example
- Container for ``rule`` elements
- The rules are evaluated in this order.
+Rules describe designspace areas in which one glyph should be replaced by another.
+A rule has a name and a number of conditionsets. The rule also contains a list of
+glyphname pairs: the glyphs that need to be substituted. For a rule to be triggered
+**only one** of the conditionsets needs to be true, ``OR``. Within a conditionset
+**all** conditions need to be true, ``AND``.
+
+.. attributes-11:
+
+Attributes
+----------
+
+- ``processing``: flag, optional. Valid values are [``first``, ``last``]. This flag indicates whether the substitution rules should be applied before or after other glyph substitution features.
+- If no ``processing`` attribute is given, interpret as ``first``, and put the substitution rule in the `rvrn` feature.
+- If ``processing`` is ``last``, put it in `rclt`.
+
.. 51-rule-element:
5.1 rule element
@@ -853,8 +866,8 @@ Example
- Defines a named rule.
- Each ``rule`` element contains one or more ``conditionset`` elements.
-- Only one ``conditionset`` needs to be true to trigger the rule.
-- All conditions in a ``conditionset`` must be true to make the ``conditionset`` true.
+- **Only one** ``conditionset`` needs to be true to trigger the rule.
+- **All** conditions in a ``conditionset`` must be true to make the ``conditionset`` true.
- For backwards compatibility a ``rule`` can contain ``condition`` elements outside of a conditionset. These are then understood to be part of a single, implied, ``conditionset``. Note: these conditions should be written wrapped in a conditionset.
- A rule element needs to contain one or more ``sub`` elements in order to be compiled to a variable font.
- Rules without sub elements should be ignored when compiling a font.
@@ -881,9 +894,10 @@ Attributes
=======================
- Child element of ``conditionset``
-- Between the ``minimum`` and ``maximum`` this rule is ``True``.
-- If ``minimum`` is not available, assume it is ``axis.minimum``.
-- If ``maximum`` is not available, assume it is ``axis.maximum``.
+- Between the ``minimum`` and ``maximum`` this condition is ``True``.
+- ``minimum`` and ``maximum`` are in designspace coordinates.
+- If ``minimum`` is not available, assume it is ``axis.minimum``, mapped to designspace coordinates.
+- If ``maximum`` is not available, assume it is ``axis.maximum``, mapped to designspace coordinates.
- The condition must contain at least a minimum or maximum or both.
.. attributes-12:
@@ -893,8 +907,8 @@ Attributes
- ``name``: string, required. Must match one of the defined ``axis``
name attributes.
-- ``minimum``: number, required*. The low value.
-- ``maximum``: number, required*. The high value.
+- ``minimum``: number, required*. The low value, in designspace coordinates.
+- ``maximum``: number, required*. The high value, in designspace coordinates.
.. 513-sub-element:
@@ -903,6 +917,9 @@ Attributes
- Child element of ``rule``.
- Defines which glyph to replace when the rule evaluates to **True**.
+- The ``sub`` element contains a pair of glyphnames. The ``name`` attribute is the glyph that should be visible when the rule evaluates to **False**. The ``with`` attribute is the glyph that should be visible when the rule evaluates to **True**.
+
+Axis values in Conditions are in designspace coordinates.
.. attributes-13:
@@ -914,7 +931,7 @@ Attributes
- ``with``: string, required. The name of the glyph it is replaced
with.
-.. example-7:
+.. example-8:
Example
-------
@@ -924,7 +941,7 @@ contained in a conditionset.
.. code:: xml
- <rules>
+ <rules processing="last">
<rule name="named.rule.1">
<condition minimum="250" maximum="750" name="weight" />
<condition minimum="50" maximum="100" name="width" />
@@ -1059,9 +1076,75 @@ any of the UFOs. If the lib key is empty or not present in the Designspace, all
glyphs should be exported, regardless of what the same lib key in any of the
UFOs says.
-.. 8-this-document:
+.. 8-implementation-and-differences:
+
+
+8 Implementation and differences
+================================
+
+The designspace format has gone through considerable development.
+
+ - the format was originally written for MutatorMath.
+ - the format is now also used in fontTools.varlib.
+ - not all values are be required by all implementations.
-8 This document
+8.1 Varlib vs. MutatorMath
+--------------------------
+
+There are some differences between the way MutatorMath and fontTools.varlib handle designspaces.
+
+ - Varlib does not support anisotropic interpolations.
+ - MutatorMath will extrapolate over the boundaries of
+ the axes. Varlib can not (at the moment).
+ - Varlib requires much less data to define an instance than
+ MutatorMath.
+ - The goals of Varlib and MutatorMath are different, so not all
+ attributes are always needed.
+
+8.2 Older versions
+------------------
+
+- In some implementations that preceed Variable Fonts, the `copyInfo`
+ flag in a source indicated the source was to be treated as the default.
+ This is no longer compatible with the assumption that the default font
+ is located on the default value of each axis.
+- Older implementations did not require axis records to be present in
+ the designspace file. The axis extremes for instance were generated
+ from the locations used in the sources. This is no longer possible.
+
+8.3 Rules and generating static UFO instances
+---------------------------------------------
+
+When making instances as UFOs from a designspace with rules, it can
+be useful to evaluate the rules so that the characterset of the ufo
+reflects, as much as possible, the state of a variable font when seen
+at the same location. This can be done by some swapping and renaming of
+glyphs.
+
+While useful for proofing or development work, it should be noted that
+swapping and renaming leaves the UFOs with glyphnames that are no longer
+descriptive. For instance, after a swap `dollar.bar` could contain a shape
+without a bar. Also, when the swapped glyphs are part of other GSUB variations
+it can become complex very quickly. So proceed with caution.
+
+ - Assuming `rulesProcessingLast = True`:
+ - We need to swap the glyphs so that the original shape is still available.
+ For instance, if a rule swaps ``a`` for ``a.alt``, a glyph
+ that references ``a`` in a component would then show the new ``a.alt``.
+ - But that can lead to unexpected results, the two glyphs may have different
+ widths or height. So, glyphs that are not specifically referenced in a rule
+ **should not change appearance**. That means that the implementation that swaps
+ ``a`` and ``a.alt`` also swap all components that reference these
+ glyphs in order to preserve their appearance.
+ - The swap function also needs to take care of swapping the names in
+ kerning data and any GPOS code.
+
+
+.. 9-this-document
+
+9 This document
===============
-- The package is rather new and changes are to be expected.
+- Changes are to be expected.
+
+
diff --git a/Doc/source/developer.rst b/Doc/source/developer.rst
new file mode 100644
index 00000000..3e259f0e
--- /dev/null
+++ b/Doc/source/developer.rst
@@ -0,0 +1,115 @@
+.. _developerinfo:
+.. image:: ../../Icons/FontToolsIconGreenCircle.png
+ :width: 200px
+ :height: 200px
+ :alt: Font Tools
+ :align: center
+
+
+fontTools Developer Information
+===============================
+
+If you would like to contribute to the development of fontTools, 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 the Python 3 `venv <https://docs.python.org/3/library/venv.html>`_ module::
+
+ # 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 venv fonttools-venv
+
+ # source the `activate` shell script to enter the environment (Un*x)
+ . 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 .
+
+
+.. note::
+
+ To exit a Python virtual environment, enter the command ``deactivate``.
+
+Testing
+-------
+
+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``.
+
+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 Python versions that are not available on your system ``PATH`` will be skipped.
+
+You can specify a particular testing environment list via the ``-e`` option, or the ``TOXENV`` environment variable::
+
+ tox -e py36
+ TOXENV="py36-cov,htmlcov" tox
+
+
+Development Community
+---------------------
+
+fontTools development is ongoing in an active community of developers that includes professional developers employed at major software corporations and type foundries as well as hobbyists.
+
+Feature requests and bug reports are always welcome at https://github.com/fonttools/fonttools/issues/
+
+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, 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
+-------
+
+`MIT license <https://github.com/fonttools/fonttools/blob/master/LICENSE>`_. See the full text of the license for details.
+
+.. |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
+.. |Coverage Status| image:: https://codecov.io/gh/fonttools/fonttools/branch/master/graph/badge.svg
+ :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
+ :target: https://gitter.im/fonttools-dev/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
diff --git a/Doc/source/encodings.rst b/Doc/source/encodings.rst
deleted file mode 100644
index 8bcd38a2..00000000
--- a/Doc/source/encodings.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-#########
-encodings
-#########
-
-.. automodule:: fontTools.encodings
- :members:
- :undoc-members:
-
-codecs
-------
-
-.. automodule:: fontTools.encodings.codecs
- :members:
- :undoc-members:
diff --git a/Doc/source/encodings/index.rst b/Doc/source/encodings/index.rst
new file mode 100644
index 00000000..32d13c70
--- /dev/null
+++ b/Doc/source/encodings/index.rst
@@ -0,0 +1,21 @@
+##################################################
+encodings: Support for OpenType-specific encodings
+##################################################
+
+fontTools includes support for some character encodings found in legacy Mac
+TrueType fonts. Many of these legacy encodings have found their way into the
+standard Python ``encodings`` library, but others still remain unimplemented.
+Importing ``fontTools.encodings.codecs`` will therefore add string ``encode``
+and ``decode`` support for the following encodings:
+
+* ``x_mac_japanese_ttx``
+* ``x_mac_trad_chinese_ttx``
+* ``x_mac_korean_ttx``
+* ``x_mac_simp_chinese_ttx``
+
+fontTools also includes a package (``fontTools.encodings.MacRoman``) which
+contains a mapping of glyph IDs to glyph names in the MacRoman character set::
+
+ >>> from fontTools.encodings.MacRoman import MacRoman
+ >>> MacRoman[26]
+ 'twosuperior'
diff --git a/Doc/source/feaLib.rst b/Doc/source/feaLib.rst
deleted file mode 100644
index ad69217c..00000000
--- a/Doc/source/feaLib.rst
+++ /dev/null
@@ -1,43 +0,0 @@
-######
-feaLib
-######
-
-.. automodule:: fontTools.feaLib
- :members:
- :undoc-members:
-
-ast
----
-
-.. automodule:: fontTools.feaLib.ast
- :members:
- :undoc-members:
-
-builder
--------
-
-.. automodule:: fontTools.feaLib.builder
- :members:
- :undoc-members:
-
-error
------
-
-.. automodule:: fontTools.feaLib.parser
- :members:
- :undoc-members:
-
-lexer
------
-
-.. automodule:: fontTools.feaLib.lexer
- :members:
- :undoc-members:
-
-parser
-------
-
-.. automodule:: fontTools.feaLib.parser
- :members:
- :undoc-members:
-
diff --git a/Doc/source/feaLib/index.rst b/Doc/source/feaLib/index.rst
new file mode 100644
index 00000000..61ac31f3
--- /dev/null
+++ b/Doc/source/feaLib/index.rst
@@ -0,0 +1,40 @@
+#########################################
+feaLib: Read/write OpenType feature files
+#########################################
+
+fontTools' ``feaLib`` allows for the creation and parsing of Adobe
+Font Development Kit for OpenType feature (``.fea``) files. The syntax
+of these files is described `here <https://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html>`_.
+
+The :class:`fontTools.feaLib.parser.Parser` class can be used to parse files
+into an abstract syntax tree, and from there the
+:class:`fontTools.feaLib.builder.Builder` class can add features to an existing
+font file. You can inspect the parsed syntax tree, walk the tree and do clever
+things with it, and also generate your own feature files programmatically, by
+using the classes in the :mod:`fontTools.feaLib.ast` module.
+
+Parsing
+-------
+
+.. autoclass:: fontTools.feaLib.parser.Parser
+ :members: parse
+ :member-order: bysource
+
+Building
+---------
+
+.. automodule:: fontTools.feaLib.builder
+ :members: addOpenTypeFeatures, addOpenTypeFeaturesFromString
+
+Generation/Interrogation
+------------------------
+
+.. _`glyph-containing object`:
+.. _`glyph-containing objects`:
+
+In the below, a **glyph-containing object** is an object of one of the following
+classes: :class:`GlyphName`, :class:`GlyphClass`, :class:`GlyphClassName`.
+
+.. automodule:: fontTools.feaLib.ast
+ :member-order: bysource
+ :members:
diff --git a/Doc/source/index.rst b/Doc/source/index.rst
index b3d44cf0..2162cc13 100644
--- a/Doc/source/index.rst
+++ b/Doc/source/index.rst
@@ -1,28 +1,152 @@
+.. image:: ../../Icons/FontToolsIconGreenCircle.png
+ :width: 200px
+ :height: 200px
+ :alt: Font Tools
+ :align: center
+
+
fontTools Docs
==============
+About
+-----
+
+fontTools is a family of libraries and utilities for manipulating fonts in Python.
+
+The 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.
+
+Installation
+------------
+
+.. note::
+
+ fontTools requires `Python <http://www.python.org/download/>`_ 3.6 or later.
+
+The package is listed in the Python Package Index (PyPI), so you can install it with `pip <https://pip.pypa.io/>`_::
+
+ pip install fonttools
+
+See the Optional Requirements section below for details about module-specific dependencies that must be installed in select cases.
+
+Utilities
+---------
+
+fontTools installs four command-line utilities:
+
+- ``pyftmerge``, a tool for merging fonts; see :py:mod:`fontTools.merge`
+- ``pyftsubset``, a tool for subsetting fonts; see :py:mod:`fontTools.subset`
+- ``ttx``, a tool for converting between OpenType binary fonts (OTF) and an XML representation (TTX); see :py:mod:`fontTools.ttx`
+- ``fonttools``, a "meta-tool" for accessing other components of the fontTools family.
+
+This last utility takes a subcommand, which could be one of:
+
+- ``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
+- ``help``: Show this help
+- ``merge``: Merge multiple fonts into one
+- ``mtiLib``: Convert a FontDame OTL file to TTX XML
+- ``subset``: OpenType font subsetter and optimizer
+- ``ttLib.woff2``: Compress and decompress WOFF2 fonts
+- ``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.
+- ``varLib.interpolatable``: Test for interpolatability issues between fonts
+- ``varLib.interpolate_layout``: Interpolate GDEF/GPOS/GSUB tables for a point on a designspace
+- ``varLib.models``: Normalize locations on a given designspace
+- ``varLib.mutator``: Instantiate a variation font
+- ``varLib.varStore``: Optimize a font's GDEF variation store
+
+Libraries
+---------
+
+The main library you will want to access when using fontTools for font
+engineering is likely to be :py:mod:`fontTools.ttLib`, which is the package
+for handling TrueType/OpenType fonts. However, there are many other
+libraries in the fontTools suite:
+
+- :py:mod:`fontTools.afmLib`: Module for reading and writing AFM files
+- :py:mod:`fontTools.agl`: Access to the Adobe Glyph List
+- :py:mod:`fontTools.cffLib`: Read/write tools for Adobe CFF fonts
+- :py:mod:`fontTools.colorLib`: Module for handling colors in CPAL/COLR fonts
+- :py:mod:`fontTools.cu2qu`: Module for cubic to quadratic conversion
+- :py:mod:`fontTools.designspaceLib`: Read and write designspace files
+- :py:mod:`fontTools.encodings`: Support for font-related character encodings
+- :py:mod:`fontTools.feaLib`: Read and read AFDKO feature files
+- :py:mod:`fontTools.fontBuilder`: Construct TTF/OTF fonts from scratch
+- :py:mod:`fontTools.merge`: Tools for merging font files
+- :py:mod:`fontTools.pens`: Various classes for manipulating glyph outlines
+- :py:mod:`fontTools.subset`: OpenType font subsetting and optimization
+- :py:mod:`fontTools.svgLib.path`: Library for drawing SVG paths onto glyphs
+- :py:mod:`fontTools.t1Lib`: Tools for PostScript Type 1 fonts (Python2 only)
+- :py:mod:`fontTools.ttx`: Module for converting between OTF and XML representation
+- :py:mod:`fontTools.ufoLib`: Module for reading and writing UFO files
+- :py:mod:`fontTools.unicodedata`: Convert between Unicode and OpenType script information
+- :py:mod:`fontTools.varLib`: Module for dealing with 'gvar'-style font variations
+- :py:mod:`fontTools.voltLib`: Module for dealing with Visual OpenType Layout Tool (VOLT) files
+
+A 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.
+
+Optional Dependencies
+---------------------
+
+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. See the :doc:`optional requirements <./optional>`
+page for more information.
+
+Developer information
+---------------------
+
+Information for developers can be found :doc:`here <./developer>`.
+
+License
+-------
+
+`MIT license <https://github.com/fonttools/fonttools/blob/master/LICENSE>`_. See the full text of the license for details.
+
+
+Table of Contents
+-----------------
+
.. toctree::
- :maxdepth: 1
+ :maxdepth: 2
+ :caption: Library
afmLib
agl
- cffLib
+ cffLib/index
+ colorLib/index
+ cu2qu/index
designspaceLib/index
- encodings
- feaLib
+ encodings/index
+ feaLib/index
merge
misc/index
+ mtiLib
+ otlLib/index
pens/index
- subset
+ subset/index
+ svgLib/index
t1Lib
ttLib/index
ttx
+ ufoLib/index
+ unicode
+ unicodedata/index
varLib/index
voltLib
-Indices and tables
-==================
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
+.. |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
+.. |Coverage Status| image:: https://codecov.io/gh/fonttools/fonttools/branch/master/graph/badge.svg
+ :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
+ :target: https://gitter.im/fonttools-dev/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge \ No newline at end of file
diff --git a/Doc/source/merge.rst b/Doc/source/merge.rst
index 74cf9ade..31146155 100644
--- a/Doc/source/merge.rst
+++ b/Doc/source/merge.rst
@@ -1,7 +1,10 @@
-#####
-merge
-#####
+####################################
+merge: Merge multiple fonts into one
+####################################
-.. automodule:: fontTools.merge
+``fontTools.merge`` provides both a library and a command line interface
+(``fonttools merge``) for merging multiple fonts together.
+
+.. autoclass:: fontTools.merge.Merger
+ :inherited-members:
:members:
- :undoc-members:
diff --git a/Doc/source/misc/arrayTools.rst b/Doc/source/misc/arrayTools.rst
index acb2a515..d996cc20 100644
--- a/Doc/source/misc/arrayTools.rst
+++ b/Doc/source/misc/arrayTools.rst
@@ -1,7 +1,9 @@
-##########
-arrayTools
-##########
+#############################################
+arrayTools: Various array and rectangle tools
+#############################################
.. automodule:: fontTools.misc.arrayTools
+ :member-order: bysource
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/bezierTools.rst b/Doc/source/misc/bezierTools.rst
index c5b4d2a7..10ddc3aa 100644
--- a/Doc/source/misc/bezierTools.rst
+++ b/Doc/source/misc/bezierTools.rst
@@ -1,7 +1,8 @@
-###########
-bezierTools
-###########
+####################################################
+bezierTools: Routines for working with Bezier curves
+####################################################
.. automodule:: fontTools.misc.bezierTools
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/classifyTools.rst b/Doc/source/misc/classifyTools.rst
index b02b3509..38c35d4c 100644
--- a/Doc/source/misc/classifyTools.rst
+++ b/Doc/source/misc/classifyTools.rst
@@ -3,5 +3,6 @@ classifyTools
#############
.. automodule:: fontTools.misc.classifyTools
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/cliTools.rst b/Doc/source/misc/cliTools.rst
new file mode 100644
index 00000000..36b2aeb9
--- /dev/null
+++ b/Doc/source/misc/cliTools.rst
@@ -0,0 +1,8 @@
+###################################################################
+cliTools: Utilities for command-line interfaces and console scripts
+###################################################################
+
+.. automodule:: fontTools.misc.cliTools
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/misc/eexec.rst b/Doc/source/misc/eexec.rst
index 8506f863..b229d585 100644
--- a/Doc/source/misc/eexec.rst
+++ b/Doc/source/misc/eexec.rst
@@ -1,7 +1,8 @@
-#####
-eexec
-#####
+###############################################################
+eexec: PostScript charstring encryption and decryption routines
+###############################################################
.. automodule:: fontTools.misc.eexec
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/encodingTools.rst b/Doc/source/misc/encodingTools.rst
index ff29f668..4e4b7197 100644
--- a/Doc/source/misc/encodingTools.rst
+++ b/Doc/source/misc/encodingTools.rst
@@ -3,5 +3,6 @@ encodingTools
#############
.. automodule:: fontTools.misc.encodingTools
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/etree.rst b/Doc/source/misc/etree.rst
new file mode 100644
index 00000000..4679a1dd
--- /dev/null
+++ b/Doc/source/misc/etree.rst
@@ -0,0 +1,8 @@
+#####
+etree
+#####
+
+.. automodule:: fontTools.misc.etree
+ :inherited-members:
+ :members:
+ :undoc-members: \ No newline at end of file
diff --git a/Doc/source/misc/filenames.rst b/Doc/source/misc/filenames.rst
new file mode 100644
index 00000000..2ebef353
--- /dev/null
+++ b/Doc/source/misc/filenames.rst
@@ -0,0 +1,7 @@
+##########################################################
+filenames: Implements UFO User Name to File Name Algorithm
+##########################################################
+
+.. automodule:: fontTools.misc.filenames
+ :members: userNameToFileName
+ :undoc-members:
diff --git a/Doc/source/misc/fixedTools.rst b/Doc/source/misc/fixedTools.rst
index 30a1f028..d3785f43 100644
--- a/Doc/source/misc/fixedTools.rst
+++ b/Doc/source/misc/fixedTools.rst
@@ -1,7 +1,8 @@
-##########
-fixedTools
-##########
+######################################################
+fixedTools: Tools for working with fixed-point numbers
+######################################################
.. automodule:: fontTools.misc.fixedTools
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/index.rst b/Doc/source/misc/index.rst
index 29a7245c..bd7db09e 100644
--- a/Doc/source/misc/index.rst
+++ b/Doc/source/misc/index.rst
@@ -1,6 +1,9 @@
-####
-misc
-####
+##########################################################
+misc: Miscellaneous libraries helpful for font engineering
+##########################################################
+
+This is a collection of packages, most of which are used as internal support
+utilities by fontTools, but some of which may be more generally useful.
.. toctree::
:maxdepth: 2
@@ -8,16 +11,26 @@ misc
arrayTools
bezierTools
classifyTools
+ cliTools
eexec
encodingTools
+ etree
+ filenames
fixedTools
+ intTools
loggingTools
- sstruct
+ macCreatorType
+ macRes
+ plistlib
psCharStrings
+ psLib
+ psOperators
+ py23
+ sstruct
+ symfont
testTools
textTools
timeTools
transform
xmlReader
xmlWriter
-
diff --git a/Doc/source/misc/intTools.rst b/Doc/source/misc/intTools.rst
new file mode 100644
index 00000000..24ea231f
--- /dev/null
+++ b/Doc/source/misc/intTools.rst
@@ -0,0 +1,6 @@
+###############################################
+intTools: Tools for working with integer values
+###############################################
+
+.. automodule:: fontTools.misc.intTools
+ :members:
diff --git a/Doc/source/misc/loggingTools.rst b/Doc/source/misc/loggingTools.rst
index fb8eab58..157e0209 100644
--- a/Doc/source/misc/loggingTools.rst
+++ b/Doc/source/misc/loggingTools.rst
@@ -1,6 +1,6 @@
-############
-loggingTools
-############
+###################################################################
+loggingTools: tools for interfacing with the Python logging package
+###################################################################
.. automodule:: fontTools.misc.loggingTools
:members:
diff --git a/Doc/source/misc/macCreatorType.rst b/Doc/source/misc/macCreatorType.rst
new file mode 100644
index 00000000..809098dc
--- /dev/null
+++ b/Doc/source/misc/macCreatorType.rst
@@ -0,0 +1,9 @@
+##############################################################
+macCreatorType: Functions for working with Mac file attributes
+##############################################################
+
+This module requires the `xattr <https://pypi.org/project/xattr/>`_ module
+to be installed in order to function correctly.
+
+.. automodule:: fontTools.misc.macCreatorType
+ :members:
diff --git a/Doc/source/misc/macRes.rst b/Doc/source/misc/macRes.rst
new file mode 100644
index 00000000..6fce8e2e
--- /dev/null
+++ b/Doc/source/misc/macRes.rst
@@ -0,0 +1,11 @@
+############################################
+macRes: Tools for reading Mac resource forks
+############################################
+
+Classic Mac OS files are made up of two parts - the "data fork" which contains the file contents proper, and the "resource fork" which contains a number of structured data items called "resources". Some fonts, such as Mac "font suitcases" and Type 1 LWFN fonts, still use the resource fork for this kind of structured data, and so to read them, fontTools needs to have access to resource forks.
+
+The Inside Macintosh volume `More Macintosh Toolbox <https://developer.apple.com/library/archive/documentation/mac/pdf/MoreMacintoshToolbox.pdf#page=34>`_ explains the structure of resource and data forks.
+
+.. automodule:: fontTools.misc.macRes
+ :members: ResourceReader, Resource
+ :member-order: bysource \ No newline at end of file
diff --git a/Doc/source/misc/plistlib.rst b/Doc/source/misc/plistlib.rst
new file mode 100644
index 00000000..68570967
--- /dev/null
+++ b/Doc/source/misc/plistlib.rst
@@ -0,0 +1,9 @@
+#########################################
+plistlib: Tools for handling .plist files
+#########################################
+
+.. automodule:: fontTools.misc.plistlib
+ :members: totree, fromtree, load, loads, dump, dumps
+
+.. autoclass:: fontTools.misc.plistlib.Data
+ :members:
diff --git a/Doc/source/misc/psCharStrings.rst b/Doc/source/misc/psCharStrings.rst
index 3dc0dce3..58497f65 100644
--- a/Doc/source/misc/psCharStrings.rst
+++ b/Doc/source/misc/psCharStrings.rst
@@ -3,5 +3,6 @@ psCharStrings
#############
.. automodule:: fontTools.misc.psCharStrings
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/psLib.rst b/Doc/source/misc/psLib.rst
new file mode 100644
index 00000000..f3afa8bf
--- /dev/null
+++ b/Doc/source/misc/psLib.rst
@@ -0,0 +1,8 @@
+#####
+psLib
+#####
+
+.. automodule:: fontTools.misc.psLib
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/misc/psOperators.rst b/Doc/source/misc/psOperators.rst
new file mode 100644
index 00000000..432274e6
--- /dev/null
+++ b/Doc/source/misc/psOperators.rst
@@ -0,0 +1,8 @@
+###########
+psOperators
+###########
+
+.. automodule:: fontTools.misc.psOperators
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/misc/py23.rst b/Doc/source/misc/py23.rst
new file mode 100644
index 00000000..49a76bf1
--- /dev/null
+++ b/Doc/source/misc/py23.rst
@@ -0,0 +1,8 @@
+####
+py23
+####
+
+.. automodule:: fontTools.misc.py23
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/misc/sstruct.rst b/Doc/source/misc/sstruct.rst
index 482aa23f..0544795f 100644
--- a/Doc/source/misc/sstruct.rst
+++ b/Doc/source/misc/sstruct.rst
@@ -3,5 +3,6 @@ sstruct
#######
.. automodule:: fontTools.misc.sstruct
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/symfont.rst b/Doc/source/misc/symfont.rst
new file mode 100644
index 00000000..c189f3d9
--- /dev/null
+++ b/Doc/source/misc/symfont.rst
@@ -0,0 +1,8 @@
+#######
+symfont
+#######
+
+.. automodule:: fontTools.misc.symfont
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/misc/testTools.rst b/Doc/source/misc/testTools.rst
index b3215ac4..00197656 100644
--- a/Doc/source/misc/testTools.rst
+++ b/Doc/source/misc/testTools.rst
@@ -3,5 +3,6 @@ testTools
#########
.. automodule:: fontTools.misc.testTools
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/textTools.rst b/Doc/source/misc/textTools.rst
index 754eb675..0044c082 100644
--- a/Doc/source/misc/textTools.rst
+++ b/Doc/source/misc/textTools.rst
@@ -3,5 +3,6 @@ textTools
#########
.. automodule:: fontTools.misc.textTools
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/timeTools.rst b/Doc/source/misc/timeTools.rst
index f8d15081..c0a71990 100644
--- a/Doc/source/misc/timeTools.rst
+++ b/Doc/source/misc/timeTools.rst
@@ -3,5 +3,6 @@ timeTools
#########
.. automodule:: fontTools.misc.timeTools
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/transform.rst b/Doc/source/misc/transform.rst
index 9517fe02..44a3dbdf 100644
--- a/Doc/source/misc/transform.rst
+++ b/Doc/source/misc/transform.rst
@@ -3,5 +3,6 @@ transform
#########
.. automodule:: fontTools.misc.transform
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/xmlReader.rst b/Doc/source/misc/xmlReader.rst
index 6e093545..d0b80f5b 100644
--- a/Doc/source/misc/xmlReader.rst
+++ b/Doc/source/misc/xmlReader.rst
@@ -3,5 +3,6 @@ xmlReader
#########
.. automodule:: fontTools.misc.xmlReader
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/misc/xmlWriter.rst b/Doc/source/misc/xmlWriter.rst
index f488183d..5f7aaef5 100644
--- a/Doc/source/misc/xmlWriter.rst
+++ b/Doc/source/misc/xmlWriter.rst
@@ -3,5 +3,6 @@ xmlWriter
#########
.. automodule:: fontTools.misc.xmlWriter
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/mtiLib.rst b/Doc/source/mtiLib.rst
new file mode 100644
index 00000000..1bf74e18
--- /dev/null
+++ b/Doc/source/mtiLib.rst
@@ -0,0 +1,14 @@
+###########################################
+mtiLib: Read Monotype FontDame source files
+###########################################
+
+FontTools provides support for reading the OpenType layout tables produced by
+Monotype's FontDame and Font Chef font editors. These tables are written in a
+simple textual format. The ``mtiLib`` library parses these text files and creates
+table objects representing their contents.
+
+Additionally, ``fonttools mtiLib`` will convert a text file to TTX XML.
+
+
+.. automodule:: fontTools.mtiLib
+ :members: build, main
diff --git a/Doc/source/optional.rst b/Doc/source/optional.rst
new file mode 100644
index 00000000..09376a26
--- /dev/null
+++ b/Doc/source/optional.rst
@@ -0,0 +1,140 @@
+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
+
+ 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.
+
+.. note::
+
+ Optional dependencies are detailed by module in the list below with the ``Extra`` setting that automates ``pip`` dependency installation when this is supported.
+
+
+
+:py:mod:`fontTools.misc.etree`
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+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``
+
+
+: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.
+
+* `enum34 <https://pypi.org/pypi/enum34>`__: backport for the built-in ``enum`` module (only required on Python < 3.4).
+
+*Extra:* ``ufo``
+
+
+:py:mod:`fontTools.ttLib.woff2`
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+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``
+
+
+: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:
+
+* `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``.
+
+*Extra:* ``unicode``
+
+
+:py:mod:`fontTools.varLib.interpolatable`
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+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.
+
+*Extra:* ``interpolatable``
+
+
+:py:mod:`fontTools.varLib.plot`
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Module for visualizing DesignSpaceDocument and resulting VariationModel.
+
+* `matplotlib <https://pypi.org/pypi/matplotlib>`__: 2D plotting library.
+
+*Extra:* ``plot``
+
+
+:py:mod:`fontTools.misc.symfont`
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Advanced module for symbolic font statistics analysis; it requires:
+
+* `sympy <https://pypi.python.org/pypi/sympy>`__: the Python library for symbolic mathematics.
+
+*Extra:* ``symfont``
+
+
+:py:mod:`fontTools.t1Lib`
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+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:
+
+* `xattr <https://pypi.python.org/pypi/xattr>`__: Python wrapper for extended filesystem attributes
+ (macOS platform only).
+
+*Extra:* ``type1``
+
+
+:py:mod:`fontTools.pens.cocoaPen`
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+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.pens.qtPen`
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+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.
+
+
+:py:mod:`fontTools.pens.reportLabPen`
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Pen to drawing glyphs as PNG images, requires:
+
+* `reportlab <https://pypi.python.org/pypi/reportlab>`__: Python toolkit for generating PDFs and
+ graphics.
diff --git a/Doc/source/otlLib/index.rst b/Doc/source/otlLib/index.rst
new file mode 100644
index 00000000..1984914c
--- /dev/null
+++ b/Doc/source/otlLib/index.rst
@@ -0,0 +1,74 @@
+#################################################
+otlLib: Routines for working with OpenType Layout
+#################################################
+
+The ``fontTools.otlLib`` library provides routines to help you create the
+subtables and other data structures you need when you are editing a font's
+``GSUB`` and ``GPOS`` tables: substitution and positioning rules, anchors,
+lookups, coverage tables and so on.
+
+------------------------------------------
+High-level OpenType Layout Lookup Builders
+------------------------------------------
+
+.. automodule:: fontTools.otlLib.builder
+ :members: AlternateSubstBuilder, ChainContextPosBuilder, ChainContextSubstBuilder, LigatureSubstBuilder, MultipleSubstBuilder, CursivePosBuilder, MarkBasePosBuilder, MarkLigPosBuilder, MarkMarkPosBuilder, ReverseChainSingleSubstBuilder, SingleSubstBuilder, ClassPairPosSubtableBuilder, PairPosBuilder, SinglePosBuilder
+ :member-order: bysource
+
+--------------------------------------
+Common OpenType Layout Data Structures
+--------------------------------------
+
+.. automodule:: fontTools.otlLib.builder
+ :members: buildCoverage, buildLookup
+
+------------------------------------
+Low-level GSUB Table Lookup Builders
+------------------------------------
+
+These functions deal with the "simple" lookup types. See above for classes to
+help build more complex lookups (contextual and chaining lookups).
+
+.. automodule:: fontTools.otlLib.builder
+ :members: buildSingleSubstSubtable, buildMultipleSubstSubtable, buildAlternateSubstSubtable, buildLigatureSubstSubtable
+
+--------------------------
+GPOS Shared Table Builders
+--------------------------
+
+The functions help build the `GPOS shared tables <https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#shared-tables-value-record-anchor-table-and-mark-array-table>`_
+as defined in the OpenType spec: value records, anchors, mark arrays and
+mark record tables.
+
+.. automodule:: fontTools.otlLib.builder
+ :members: buildValue, buildAnchor, buildMarkArray, buildDevice, buildBaseArray, buildComponentRecord, buildMarkArray, buildValue
+ :member-order: bysource
+
+------------------------------------
+Low-level GPOS Table Lookup Builders
+------------------------------------
+
+These functions deal with the "simple" lookup types. See above for classes to
+help build more complex lookups (contextual and chaining lookups).
+
+.. automodule:: fontTools.otlLib.builder
+ :members: buildCursivePosSubtable, buildLigatureArray, buildMarkBasePos, buildMarkBasePosSubtable, buildMarkLigPos, buildMarkLigPosSubtable, buildPairPosClassesSubtable, buildPairPosGlyphs, buildPairPosGlyphsSubtable, buildSinglePos, buildSinglePosSubtable
+ :member-order: bysource
+
+----------------------------
+GDEF Table Subtable Builders
+----------------------------
+
+These functions build subtables for elements of the ``GDEF`` table.
+
+.. automodule:: fontTools.otlLib.builder
+ :members: buildAttachList, buildLigCaretList, buildMarkGlyphSetsDef
+ :member-order: bysource
+
+------------------
+STAT Table Builder
+------------------
+
+.. automodule:: fontTools.otlLib.builder
+ :members: buildStatTable
+ :member-order: bysource
diff --git a/Doc/source/pens/areaPen.rst b/Doc/source/pens/areaPen.rst
index 03a751be..f3f21bbb 100644
--- a/Doc/source/pens/areaPen.rst
+++ b/Doc/source/pens/areaPen.rst
@@ -3,5 +3,6 @@ areaPen
#######
.. automodule:: fontTools.pens.areaPen
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/pens/basePen.rst b/Doc/source/pens/basePen.rst
index f5965b16..87bf832b 100644
--- a/Doc/source/pens/basePen.rst
+++ b/Doc/source/pens/basePen.rst
@@ -3,5 +3,6 @@ basePen
#######
.. automodule:: fontTools.pens.basePen
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/pens/boundsPen.rst b/Doc/source/pens/boundsPen.rst
index 8de56201..a0d9ab41 100644
--- a/Doc/source/pens/boundsPen.rst
+++ b/Doc/source/pens/boundsPen.rst
@@ -3,5 +3,6 @@ boundsPen
#########
.. automodule:: fontTools.pens.boundsPen
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/pens/cocoaPen.rst b/Doc/source/pens/cocoaPen.rst
new file mode 100644
index 00000000..bbe8050e
--- /dev/null
+++ b/Doc/source/pens/cocoaPen.rst
@@ -0,0 +1,8 @@
+########
+cocoaPen
+########
+
+.. automodule:: fontTools.pens.cocoaPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/pens/cu2quPen.rst b/Doc/source/pens/cu2quPen.rst
new file mode 100644
index 00000000..4ae0249e
--- /dev/null
+++ b/Doc/source/pens/cu2quPen.rst
@@ -0,0 +1,8 @@
+########
+cu2quPen
+########
+
+.. automodule:: fontTools.pens.cu2quPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/pens/filterPen.rst b/Doc/source/pens/filterPen.rst
index 0b484a4c..c79b944c 100644
--- a/Doc/source/pens/filterPen.rst
+++ b/Doc/source/pens/filterPen.rst
@@ -3,5 +3,6 @@ filterPen
#########
.. automodule:: fontTools.pens.filterPen
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/pens/index.rst b/Doc/source/pens/index.rst
index 7e5a1926..91175cf7 100644
--- a/Doc/source/pens/index.rst
+++ b/Doc/source/pens/index.rst
@@ -5,14 +5,26 @@ pens
.. toctree::
:maxdepth: 1
+ areaPen
basePen
boundsPen
- pointInsidePen
+ cocoaPen
+ cu2quPen
filterPen
- transformPen
- t2CharStringPen
- statisticsPen
+ momentsPen
+ perimeterPen
+ pointInsidePen
+ pointPen
+ qtPen
recordingPen
+ reportLabPen
+ reverseContourPen
+ roundingPen
+ statisticsPen
+ svgPathPen
+ t2CharStringPen
teePen
- areaPen
- perimeterPen
+ transformPen
+ ttGlyphPen
+ wxPen
+
diff --git a/Doc/source/pens/momentsPen.rst b/Doc/source/pens/momentsPen.rst
new file mode 100644
index 00000000..4587f75b
--- /dev/null
+++ b/Doc/source/pens/momentsPen.rst
@@ -0,0 +1,8 @@
+##########
+momentsPen
+##########
+
+.. automodule:: fontTools.pens.momentsPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/pens/perimeterPen.rst b/Doc/source/pens/perimeterPen.rst
index 97feccaa..c625a3dc 100644
--- a/Doc/source/pens/perimeterPen.rst
+++ b/Doc/source/pens/perimeterPen.rst
@@ -3,5 +3,6 @@ perimeterPen
############
.. automodule:: fontTools.pens.perimeterPen
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/pens/pointInsidePen.rst b/Doc/source/pens/pointInsidePen.rst
index 9954e478..81a4b2e8 100644
--- a/Doc/source/pens/pointInsidePen.rst
+++ b/Doc/source/pens/pointInsidePen.rst
@@ -3,5 +3,6 @@ pointInsidePen
##############
.. automodule:: fontTools.pens.pointInsidePen
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/pens/pointPen.rst b/Doc/source/pens/pointPen.rst
new file mode 100644
index 00000000..09b98977
--- /dev/null
+++ b/Doc/source/pens/pointPen.rst
@@ -0,0 +1,8 @@
+########
+pointPen
+########
+
+.. automodule:: fontTools.pens.pointPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/pens/qtPen.rst b/Doc/source/pens/qtPen.rst
new file mode 100644
index 00000000..bfaa9b50
--- /dev/null
+++ b/Doc/source/pens/qtPen.rst
@@ -0,0 +1,8 @@
+#####
+qtPen
+#####
+
+.. automodule:: fontTools.pens.qtPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/pens/recordingPen.rst b/Doc/source/pens/recordingPen.rst
index 69e7ceb5..ee9178c5 100644
--- a/Doc/source/pens/recordingPen.rst
+++ b/Doc/source/pens/recordingPen.rst
@@ -3,5 +3,6 @@ recordingPen
############
.. automodule:: fontTools.pens.recordingPen
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/pens/reportLabPen.rst b/Doc/source/pens/reportLabPen.rst
new file mode 100644
index 00000000..7fe87847
--- /dev/null
+++ b/Doc/source/pens/reportLabPen.rst
@@ -0,0 +1,8 @@
+############
+reportLabPen
+############
+
+.. automodule:: fontTools.pens.reportLabPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/pens/reverseContourPen.rst b/Doc/source/pens/reverseContourPen.rst
new file mode 100644
index 00000000..8178e2ca
--- /dev/null
+++ b/Doc/source/pens/reverseContourPen.rst
@@ -0,0 +1,8 @@
+#################
+reverseContourPen
+#################
+
+.. automodule:: fontTools.pens.reverseContourPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/pens/roundingPen.rst b/Doc/source/pens/roundingPen.rst
new file mode 100644
index 00000000..7eb4214d
--- /dev/null
+++ b/Doc/source/pens/roundingPen.rst
@@ -0,0 +1,8 @@
+###########
+roundingPen
+###########
+
+.. automodule:: fontTools.pens.roundingPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/pens/statisticsPen.rst b/Doc/source/pens/statisticsPen.rst
index efa16089..e06e3220 100644
--- a/Doc/source/pens/statisticsPen.rst
+++ b/Doc/source/pens/statisticsPen.rst
@@ -3,5 +3,6 @@ statisticsPen
#############
.. automodule:: fontTools.pens.statisticsPen
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/pens/svgPathPen.rst b/Doc/source/pens/svgPathPen.rst
new file mode 100644
index 00000000..45bf1516
--- /dev/null
+++ b/Doc/source/pens/svgPathPen.rst
@@ -0,0 +1,8 @@
+##########
+svgPathPen
+##########
+
+.. automodule:: fontTools.pens.svgPathPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/pens/t2CharStringPen.rst b/Doc/source/pens/t2CharStringPen.rst
index d58c67aa..9d55391f 100644
--- a/Doc/source/pens/t2CharStringPen.rst
+++ b/Doc/source/pens/t2CharStringPen.rst
@@ -3,5 +3,6 @@ t2CharStringPen
###############
.. automodule:: fontTools.pens.t2CharStringPen
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/pens/teePen.rst b/Doc/source/pens/teePen.rst
index 7a0313c7..2a4558d5 100644
--- a/Doc/source/pens/teePen.rst
+++ b/Doc/source/pens/teePen.rst
@@ -3,5 +3,6 @@ teePen
######
.. automodule:: fontTools.pens.teePen
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/pens/transformPen.rst b/Doc/source/pens/transformPen.rst
index 5b414f84..3bb802a5 100644
--- a/Doc/source/pens/transformPen.rst
+++ b/Doc/source/pens/transformPen.rst
@@ -3,5 +3,6 @@ transformPen
############
.. automodule:: fontTools.pens.transformPen
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/pens/ttGlyphPen.rst b/Doc/source/pens/ttGlyphPen.rst
new file mode 100644
index 00000000..e1bf7010
--- /dev/null
+++ b/Doc/source/pens/ttGlyphPen.rst
@@ -0,0 +1,8 @@
+##########
+ttGlyphPen
+##########
+
+.. automodule:: fontTools.pens.ttGlyphPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/pens/wxPen.rst b/Doc/source/pens/wxPen.rst
new file mode 100644
index 00000000..37ce50ac
--- /dev/null
+++ b/Doc/source/pens/wxPen.rst
@@ -0,0 +1,8 @@
+#####
+wxPen
+#####
+
+.. automodule:: fontTools.pens.wxPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/subset/cff.rst b/Doc/source/subset/cff.rst
new file mode 100644
index 00000000..8c21c396
--- /dev/null
+++ b/Doc/source/subset/cff.rst
@@ -0,0 +1,8 @@
+###
+cff
+###
+
+.. automodule:: fontTools.subset.cff
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/subset.rst b/Doc/source/subset/index.rst
index a8fff95e..f32e0d42 100644
--- a/Doc/source/subset.rst
+++ b/Doc/source/subset/index.rst
@@ -2,6 +2,12 @@
subset
######
+.. toctree::
+ :maxdepth: 1
+
+ cff
+
.. automodule:: fontTools.subset
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/svgLib/index.rst b/Doc/source/svgLib/index.rst
new file mode 100644
index 00000000..f86ff0ad
--- /dev/null
+++ b/Doc/source/svgLib/index.rst
@@ -0,0 +1,8 @@
+######
+svgLib
+######
+
+.. toctree::
+ :maxdepth: 1
+
+ path/index
diff --git a/Doc/source/svgLib/path/index.rst b/Doc/source/svgLib/path/index.rst
new file mode 100644
index 00000000..0d7551b9
--- /dev/null
+++ b/Doc/source/svgLib/path/index.rst
@@ -0,0 +1,13 @@
+####
+path
+####
+
+.. toctree::
+ :maxdepth: 1
+
+ parser
+
+.. automodule:: fontTools.svgLib.path
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/svgLib/path/parser.rst b/Doc/source/svgLib/path/parser.rst
new file mode 100644
index 00000000..fc7e7ff1
--- /dev/null
+++ b/Doc/source/svgLib/path/parser.rst
@@ -0,0 +1,8 @@
+######
+parser
+######
+
+.. automodule:: fontTools.svgLib.path.parser
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/t1Lib.rst b/Doc/source/t1Lib.rst
index dcc04380..4436086f 100644
--- a/Doc/source/t1Lib.rst
+++ b/Doc/source/t1Lib.rst
@@ -3,5 +3,6 @@ t1Lib
#####
.. automodule:: fontTools.t1Lib
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/ttLib/index.rst b/Doc/source/ttLib/index.rst
index d2739348..4dfa2d66 100644
--- a/Doc/source/ttLib/index.rst
+++ b/Doc/source/ttLib/index.rst
@@ -7,9 +7,13 @@ ttLib
macUtils
sfnt
+ standardGlyphOrder
tables
+ ttCollection
+ ttFont
woff2
.. automodule:: fontTools.ttLib
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/ttLib/macUtils.rst b/Doc/source/ttLib/macUtils.rst
index cb014d76..356a911b 100644
--- a/Doc/source/ttLib/macUtils.rst
+++ b/Doc/source/ttLib/macUtils.rst
@@ -3,5 +3,6 @@ macUtils
########
.. automodule:: fontTools.ttLib.macUtils
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/ttLib/sfnt.rst b/Doc/source/ttLib/sfnt.rst
index 41e30322..29566ab7 100644
--- a/Doc/source/ttLib/sfnt.rst
+++ b/Doc/source/ttLib/sfnt.rst
@@ -3,5 +3,6 @@ sfnt
####
.. automodule:: fontTools.ttLib.sfnt
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/ttLib/standardGlyphOrder.rst b/Doc/source/ttLib/standardGlyphOrder.rst
new file mode 100644
index 00000000..ca2557bf
--- /dev/null
+++ b/Doc/source/ttLib/standardGlyphOrder.rst
@@ -0,0 +1,12 @@
+##################
+standardGlyphOrder
+##################
+
+.. automodule:: fontTools.ttLib.standardGlyphOrder
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+.. data:: fontTools.ttLib.standardGlyphOrder.standardGlyphOrder
+
+A Python list of "standard" glyphs required by post table formats 1.0 and 2.0.
diff --git a/Doc/source/ttLib/tables.rst b/Doc/source/ttLib/tables.rst
index 6ae705fb..45c76b8b 100644
--- a/Doc/source/ttLib/tables.rst
+++ b/Doc/source/ttLib/tables.rst
@@ -2,7 +2,114 @@
tables
######
+This folder is a subpackage of :py:mod:`fontTools.ttLib`. Each module here is a
+specialized TT/OT table converter: they can convert raw data
+to Python objects and vice versa. Usually you don't need to
+use the modules directly: they are imported and used
+automatically when needed by :py:mod:`fontTools.ttLib`.
+
+If you are writing you own table converter the following is
+important.
+
+The modules here have pretty strange names: this is due to the
+fact that we need to map TT table tags (which are case sensitive)
+to filenames (which on Mac and Win aren't case sensitive) as well
+as to Python identifiers. The latter means it can only contain
+[A-Za-z0-9_] and cannot start with a number.
+
+:py:mod:`fontTools.ttLib` provides functions to expand a tag into the format used here::
+
+ >>> from fontTools import ttLib
+ >>> ttLib.tagToIdentifier("FOO ")
+ 'F_O_O_'
+ >>> ttLib.tagToIdentifier("cvt ")
+ '_c_v_t'
+ >>> ttLib.tagToIdentifier("OS/2")
+ 'O_S_2f_2'
+ >>> ttLib.tagToIdentifier("glyf")
+ '_g_l_y_f'
+ >>>
+
+And vice versa::
+
+ >>> ttLib.identifierToTag("F_O_O_")
+ 'FOO '
+ >>> ttLib.identifierToTag("_c_v_t")
+ 'cvt '
+ >>> ttLib.identifierToTag("O_S_2f_2")
+ 'OS/2'
+ >>> ttLib.identifierToTag("_g_l_y_f")
+ 'glyf'
+ >>>
+
+Eg. the 'glyf' table converter lives in a Python file called::
+
+ _g_l_y_f.py
+
+The converter itself is a class, named "table_" + expandedtag. Eg::
+
+
+ class table__g_l_y_f:
+ etc.
+
+
+Note that if you _do_ need to use such modules or classes manually,
+there are two convenient API functions that let you find them by tag::
+
+ >>> ttLib.getTableModule('glyf')
+ <module 'ttLib.tables._g_l_y_f'>
+ >>> ttLib.getTableClass('glyf')
+ <class ttLib.tables._g_l_y_f.table__g_l_y_f at 645f400>
+ >>
+
+You must subclass from :py:mod:`fontTools.ttLib.tables.DefaultTable.DefaultTable`. It provides some default
+behavior, as well as a constructor method (__init__) that you don't need to
+override.
+
+Your converter should minimally provide two methods::
+
+
+ class table_F_O_O_(DefaultTable.DefaultTable): # converter for table 'FOO '
+
+ def decompile(self, data, ttFont):
+ # 'data' is the raw table data. Unpack it into a
+ # Python data structure.
+ # 'ttFont' is a ttLib.TTfile instance, enabling you to
+ # refer to other tables. Do ***not*** keep a reference to
+ # it: it will cause a circular reference (ttFont saves
+ # a reference to us), and that means we'll be leaking
+ # memory. If you need to use it in other methods, just
+ # pass it around as a method argument.
+
+ def compile(self, ttFont):
+ # Return the raw data, as converted from the Python
+ # data structure.
+ # Again, 'ttFont' is there so you can access other tables.
+ # Same warning applies.
+
+
+If you want to support TTX import/export as well, you need to provide two
+additional methods::
+
+
+ def toXML(self, writer, ttFont):
+ # XXX
+
+ def fromXML(self, (name, attrs, content), ttFont):
+ # XXX
+
+
+
.. automodule:: fontTools.ttLib.tables
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+_a_n_k_r
+--------
+
+.. automodule:: fontTools.ttLib.tables._a_n_k_r
+ :inherited-members:
:members:
:undoc-members:
@@ -10,6 +117,23 @@ _a_v_a_r
--------
.. automodule:: fontTools.ttLib.tables._a_v_a_r
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+_b_s_l_n
+--------
+
+.. automodule:: fontTools.ttLib.tables._b_s_l_n
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+_c_i_d_g
+--------
+
+.. automodule:: fontTools.ttLib.tables._c_i_d_g
+ :inherited-members:
:members:
:undoc-members:
@@ -17,6 +141,7 @@ _c_m_a_p
--------
.. automodule:: fontTools.ttLib.tables._c_m_a_p
+ :inherited-members:
:members:
:undoc-members:
@@ -24,6 +149,7 @@ _c_v_a_r
--------
.. automodule:: fontTools.ttLib.tables._c_v_a_r
+ :inherited-members:
:members:
:undoc-members:
@@ -31,6 +157,7 @@ _c_v_t
------
.. automodule:: fontTools.ttLib.tables._c_v_t
+ :inherited-members:
:members:
:undoc-members:
@@ -38,6 +165,7 @@ _f_e_a_t
--------
.. automodule:: fontTools.ttLib.tables._f_e_a_t
+ :inherited-members:
:members:
:undoc-members:
@@ -45,6 +173,7 @@ _f_p_g_m
--------
.. automodule:: fontTools.ttLib.tables._f_p_g_m
+ :inherited-members:
:members:
:undoc-members:
@@ -52,6 +181,7 @@ _f_v_a_r
--------
.. automodule:: fontTools.ttLib.tables._f_v_a_r
+ :inherited-members:
:members:
:undoc-members:
@@ -59,6 +189,16 @@ _g_a_s_p
--------
.. automodule:: fontTools.ttLib.tables._g_a_s_p
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+
+_g_c_i_d
+--------
+
+.. automodule:: fontTools.ttLib.tables._g_c_i_d
+ :inherited-members:
:members:
:undoc-members:
@@ -66,6 +206,7 @@ _g_l_y_f
--------
.. automodule:: fontTools.ttLib.tables._g_l_y_f
+ :inherited-members:
:members:
:undoc-members:
@@ -73,6 +214,7 @@ _g_v_a_r
--------
.. automodule:: fontTools.ttLib.tables._g_v_a_r
+ :inherited-members:
:members:
:undoc-members:
@@ -80,6 +222,7 @@ _h_d_m_x
--------
.. automodule:: fontTools.ttLib.tables._h_d_m_x
+ :inherited-members:
:members:
:undoc-members:
@@ -87,6 +230,7 @@ _h_e_a_d
--------
.. automodule:: fontTools.ttLib.tables._h_e_a_d
+ :inherited-members:
:members:
:undoc-members:
@@ -94,6 +238,7 @@ _h_h_e_a
--------
.. automodule:: fontTools.ttLib.tables._h_h_e_a
+ :inherited-members:
:members:
:undoc-members:
@@ -101,6 +246,7 @@ _h_m_t_x
--------
.. automodule:: fontTools.ttLib.tables._h_m_t_x
+ :inherited-members:
:members:
:undoc-members:
@@ -108,6 +254,15 @@ _k_e_r_n
--------
.. automodule:: fontTools.ttLib.tables._k_e_r_n
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+_l_c_a_r
+--------
+
+.. automodule:: fontTools.ttLib.tables._l_c_a_r
+ :inherited-members:
:members:
:undoc-members:
@@ -115,6 +270,7 @@ _l_o_c_a
--------
.. automodule:: fontTools.ttLib.tables._l_o_c_a
+ :inherited-members:
:members:
:undoc-members:
@@ -122,6 +278,7 @@ _l_t_a_g
--------
.. automodule:: fontTools.ttLib.tables._l_t_a_g
+ :inherited-members:
:members:
:undoc-members:
@@ -129,6 +286,7 @@ _m_a_x_p
--------
.. automodule:: fontTools.ttLib.tables._m_a_x_p
+ :inherited-members:
:members:
:undoc-members:
@@ -136,6 +294,24 @@ _m_e_t_a
--------
.. automodule:: fontTools.ttLib.tables._m_e_t_a
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+_m_o_r_t
+--------
+
+.. automodule:: fontTools.ttLib.tables._m_o_r_t
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+
+_m_o_r_x
+--------
+
+.. automodule:: fontTools.ttLib.tables._m_o_r_x
+ :inherited-members:
:members:
:undoc-members:
@@ -143,6 +319,15 @@ _n_a_m_e
--------
.. automodule:: fontTools.ttLib.tables._n_a_m_e
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+_o_p_b_d
+--------
+
+.. automodule:: fontTools.ttLib.tables._o_p_b_d
+ :inherited-members:
:members:
:undoc-members:
@@ -150,6 +335,7 @@ _p_o_s_t
--------
.. automodule:: fontTools.ttLib.tables._p_o_s_t
+ :inherited-members:
:members:
:undoc-members:
@@ -157,6 +343,16 @@ _p_r_e_p
--------
.. automodule:: fontTools.ttLib.tables._p_r_e_p
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+
+_p_r_o_p
+--------
+
+.. automodule:: fontTools.ttLib.tables._p_r_o_p
+ :inherited-members:
:members:
:undoc-members:
@@ -164,6 +360,7 @@ _s_b_i_x
--------
.. automodule:: fontTools.ttLib.tables._s_b_i_x
+ :inherited-members:
:members:
:undoc-members:
@@ -171,6 +368,7 @@ _t_r_a_k
--------
.. automodule:: fontTools.ttLib.tables._t_r_a_k
+ :inherited-members:
:members:
:undoc-members:
@@ -178,6 +376,7 @@ _v_h_e_a
--------
.. automodule:: fontTools.ttLib.tables._v_h_e_a
+ :inherited-members:
:members:
:undoc-members:
@@ -185,6 +384,7 @@ _v_m_t_x
--------
.. automodule:: fontTools.ttLib.tables._v_m_t_x
+ :inherited-members:
:members:
:undoc-members:
@@ -192,6 +392,7 @@ asciiTable
----------
.. automodule:: fontTools.ttLib.tables.asciiTable
+ :inherited-members:
:members:
:undoc-members:
@@ -199,6 +400,7 @@ B_A_S_E_
--------
.. automodule:: fontTools.ttLib.tables.B_A_S_E_
+ :inherited-members:
:members:
:undoc-members:
@@ -206,6 +408,7 @@ BitmapGlyphMetrics
------------------
.. automodule:: fontTools.ttLib.tables.BitmapGlyphMetrics
+ :inherited-members:
:members:
:undoc-members:
@@ -213,6 +416,7 @@ C_B_D_T_
--------
.. automodule:: fontTools.ttLib.tables.C_B_D_T_
+ :inherited-members:
:members:
:undoc-members:
@@ -220,6 +424,7 @@ C_B_L_C_
--------
.. automodule:: fontTools.ttLib.tables.C_B_L_C_
+ :inherited-members:
:members:
:undoc-members:
@@ -227,6 +432,7 @@ C_F_F_
------
.. automodule:: fontTools.ttLib.tables.C_F_F_
+ :inherited-members:
:members:
:undoc-members:
@@ -234,6 +440,7 @@ C_F_F__2
--------
.. automodule:: fontTools.ttLib.tables.C_F_F__2
+ :inherited-members:
:members:
:undoc-members:
@@ -241,6 +448,7 @@ C_O_L_R_
--------
.. automodule:: fontTools.ttLib.tables.C_O_L_R_
+ :inherited-members:
:members:
:undoc-members:
@@ -248,6 +456,7 @@ C_P_A_L_
--------
.. automodule:: fontTools.ttLib.tables.C_P_A_L_
+ :inherited-members:
:members:
:undoc-members:
@@ -255,6 +464,7 @@ D_S_I_G_
--------
.. automodule:: fontTools.ttLib.tables.D_S_I_G_
+ :inherited-members:
:members:
:undoc-members:
@@ -262,6 +472,7 @@ DefaultTable
------------
.. automodule:: fontTools.ttLib.tables.DefaultTable
+ :inherited-members:
:members:
:undoc-members:
@@ -269,6 +480,7 @@ E_B_D_T_
--------
.. automodule:: fontTools.ttLib.tables.E_B_D_T_
+ :inherited-members:
:members:
:undoc-members:
@@ -276,13 +488,41 @@ E_B_L_C_
--------
.. automodule:: fontTools.ttLib.tables.E_B_L_C_
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+F__e_a_t
+--------
+
+.. automodule:: fontTools.ttLib.tables.F__e_a_t
+ :inherited-members:
:members:
:undoc-members:
+
F_F_T_M_
--------
.. automodule:: fontTools.ttLib.tables.F_F_T_M_
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+
+G__l_a_t
+--------
+
+.. automodule:: fontTools.ttLib.tables.G__l_a_t
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+G__l_o_c
+--------
+
+.. automodule:: fontTools.ttLib.tables.G__l_o_c
+ :inherited-members:
:members:
:undoc-members:
@@ -290,6 +530,7 @@ G_D_E_F_
--------
.. automodule:: fontTools.ttLib.tables.G_D_E_F_
+ :inherited-members:
:members:
:undoc-members:
@@ -297,6 +538,7 @@ G_M_A_P_
--------
.. automodule:: fontTools.ttLib.tables.G_M_A_P_
+ :inherited-members:
:members:
:undoc-members:
@@ -304,6 +546,7 @@ G_P_K_G_
--------
.. automodule:: fontTools.ttLib.tables.G_P_K_G_
+ :inherited-members:
:members:
:undoc-members:
@@ -311,6 +554,7 @@ G_P_O_S_
--------
.. automodule:: fontTools.ttLib.tables.G_P_O_S_
+ :inherited-members:
:members:
:undoc-members:
@@ -318,6 +562,15 @@ G_S_U_B_
--------
.. automodule:: fontTools.ttLib.tables.G_S_U_B_
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+grUtils
+-------
+
+.. automodule:: fontTools.ttLib.tables.grUtils
+ :inherited-members:
:members:
:undoc-members:
@@ -325,6 +578,7 @@ H_V_A_R_
--------
.. automodule:: fontTools.ttLib.tables.H_V_A_R_
+ :inherited-members:
:members:
:undoc-members:
@@ -332,6 +586,7 @@ J_S_T_F_
--------
.. automodule:: fontTools.ttLib.tables.J_S_T_F_
+ :inherited-members:
:members:
:undoc-members:
@@ -339,6 +594,7 @@ L_T_S_H_
--------
.. automodule:: fontTools.ttLib.tables.L_T_S_H_
+ :inherited-members:
:members:
:undoc-members:
@@ -346,6 +602,7 @@ M_A_T_H_
--------
.. automodule:: fontTools.ttLib.tables.M_A_T_H_
+ :inherited-members:
:members:
:undoc-members:
@@ -353,6 +610,7 @@ M_E_T_A_
--------
.. automodule:: fontTools.ttLib.tables.M_E_T_A_
+ :inherited-members:
:members:
:undoc-members:
@@ -360,6 +618,7 @@ M_V_A_R_
--------
.. automodule:: fontTools.ttLib.tables.M_V_A_R_
+ :inherited-members:
:members:
:undoc-members:
@@ -367,6 +626,7 @@ O_S_2f_2
--------
.. automodule:: fontTools.ttLib.tables.O_S_2f_2
+ :inherited-members:
:members:
:undoc-members:
@@ -374,6 +634,7 @@ otBase
------
.. automodule:: fontTools.ttLib.tables.otBase
+ :inherited-members:
:members:
:undoc-members:
@@ -381,6 +642,7 @@ otConverters
------------
.. automodule:: fontTools.ttLib.tables.otConverters
+ :inherited-members:
:members:
:undoc-members:
@@ -388,6 +650,7 @@ otData
------
.. automodule:: fontTools.ttLib.tables.otData
+ :inherited-members:
:members:
:undoc-members:
@@ -395,6 +658,23 @@ otTables
--------
.. automodule:: fontTools.ttLib.tables.otTables
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+S__i_l_f
+--------
+
+.. automodule:: fontTools.ttLib.tables.S__i_l_f
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+S__i_l_l
+--------
+
+.. automodule:: fontTools.ttLib.tables.S__i_l_l
+ :inherited-members:
:members:
:undoc-members:
@@ -402,6 +682,7 @@ S_I_N_G_
--------
.. automodule:: fontTools.ttLib.tables.S_I_N_G_
+ :inherited-members:
:members:
:undoc-members:
@@ -409,6 +690,7 @@ S_T_A_T_
--------
.. automodule:: fontTools.ttLib.tables.S_T_A_T_
+ :inherited-members:
:members:
:undoc-members:
@@ -416,6 +698,7 @@ S_V_G_
------
.. automodule:: fontTools.ttLib.tables.S_V_G_
+ :inherited-members:
:members:
:undoc-members:
@@ -423,6 +706,7 @@ sbixGlyph
---------
.. automodule:: fontTools.ttLib.tables.sbixGlyph
+ :inherited-members:
:members:
:undoc-members:
@@ -430,6 +714,7 @@ sbixStrike
----------
.. automodule:: fontTools.ttLib.tables.sbixStrike
+ :inherited-members:
:members:
:undoc-members:
@@ -437,6 +722,7 @@ T_S_I__0
--------
.. automodule:: fontTools.ttLib.tables.T_S_I__0
+ :inherited-members:
:members:
:undoc-members:
@@ -444,6 +730,7 @@ T_S_I__1
--------
.. automodule:: fontTools.ttLib.tables.T_S_I__1
+ :inherited-members:
:members:
:undoc-members:
@@ -451,6 +738,7 @@ T_S_I__2
--------
.. automodule:: fontTools.ttLib.tables.T_S_I__2
+ :inherited-members:
:members:
:undoc-members:
@@ -458,6 +746,7 @@ T_S_I__3
--------
.. automodule:: fontTools.ttLib.tables.T_S_I__3
+ :inherited-members:
:members:
:undoc-members:
@@ -465,6 +754,71 @@ T_S_I__5
--------
.. automodule:: fontTools.ttLib.tables.T_S_I__5
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+T_S_I_B_
+--------
+
+.. automodule:: fontTools.ttLib.tables.T_S_I_B_
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+T_S_I_C_
+--------
+
+.. automodule:: fontTools.ttLib.tables.T_S_I_C_
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+T_S_I_D_
+--------
+
+.. automodule:: fontTools.ttLib.tables.T_S_I_D_
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+T_S_I_J_
+--------
+
+.. automodule:: fontTools.ttLib.tables.T_S_I_J_
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+T_S_I_P_
+--------
+
+.. automodule:: fontTools.ttLib.tables.T_S_I_P_
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+T_S_I_S_
+--------
+
+.. automodule:: fontTools.ttLib.tables.T_S_I_S_
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+T_S_I_V_
+--------
+
+.. automodule:: fontTools.ttLib.tables.T_S_I_V_
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+T_T_F_A_
+--------
+
+.. automodule:: fontTools.ttLib.tables.T_T_F_A_
+ :inherited-members:
:members:
:undoc-members:
@@ -472,6 +826,7 @@ ttProgram
---------
.. automodule:: fontTools.ttLib.tables.ttProgram
+ :inherited-members:
:members:
:undoc-members:
@@ -479,6 +834,7 @@ TupleVariation
--------------
.. automodule:: fontTools.ttLib.tables.TupleVariation
+ :inherited-members:
:members:
:undoc-members:
@@ -486,6 +842,7 @@ V_D_M_X_
--------
.. automodule:: fontTools.ttLib.tables.V_D_M_X_
+ :inherited-members:
:members:
:undoc-members:
@@ -493,6 +850,7 @@ V_O_R_G_
--------
.. automodule:: fontTools.ttLib.tables.V_O_R_G_
+ :inherited-members:
:members:
:undoc-members:
@@ -500,6 +858,7 @@ V_V_A_R_
--------
.. automodule:: fontTools.ttLib.tables.V_V_A_R_
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/ttLib/ttCollection.rst b/Doc/source/ttLib/ttCollection.rst
new file mode 100644
index 00000000..0ca4ebd0
--- /dev/null
+++ b/Doc/source/ttLib/ttCollection.rst
@@ -0,0 +1,8 @@
+############
+ttCollection
+############
+
+.. automodule:: fontTools.ttLib.ttCollection
+ :inherited-members:
+ :members:
+ :undoc-members: \ No newline at end of file
diff --git a/Doc/source/ttLib/ttFont.rst b/Doc/source/ttLib/ttFont.rst
new file mode 100644
index 00000000..a571050c
--- /dev/null
+++ b/Doc/source/ttLib/ttFont.rst
@@ -0,0 +1,9 @@
+######
+ttFont
+######
+
+.. automodule:: fontTools.ttLib.ttFont
+ :inherited-members:
+ :members:
+ :undoc-members:
+ :private-members:
diff --git a/Doc/source/ttLib/woff2.rst b/Doc/source/ttLib/woff2.rst
index 0c464be6..327bb5b2 100644
--- a/Doc/source/ttLib/woff2.rst
+++ b/Doc/source/ttLib/woff2.rst
@@ -3,5 +3,6 @@ woff2
#####
.. automodule:: fontTools.ttLib.woff2
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/ttx.rst b/Doc/source/ttx.rst
index 1c909015..b6e43f5d 100644
--- a/Doc/source/ttx.rst
+++ b/Doc/source/ttx.rst
@@ -2,6 +2,61 @@
ttx
###
+
+TTX – From OpenType and TrueType to XML and Back
+------------------------------------------------
+
+Once installed you can use the ttx command to convert binary font files (.otf, .ttf, etc) to the TTX XML format, edit them, and convert them back to binary format. TTX files have a .ttx file extension::
+
+ ttx /path/to/font.otf
+ ttx /path/to/font.ttx
+
+The TTX application can be used in two ways, depending on what platform you run it on:
+
+* As a command line tool (Windows/DOS, Unix, macOS)
+* By dropping files onto the application (Windows, macOS)
+
+TTX detects what kind of files it is fed: it will output a ``.ttx`` file when it sees a ``.ttf`` or ``.otf``, and it will compile a ``.ttf`` or ``.otf`` when the input file is a ``.ttx`` file. By default, the output file is created in the same folder as the input file, and will have the same name as the input file but with a different extension. TTX will never overwrite existing files, but if necessary will append a unique number to the output filename (before the extension) such as ``Arial#1.ttf``.
+
+When using TTX from the command line there are a bunch of extra options. These are explained in the help text, as displayed when typing ``ttx -h`` at the command prompt. These additional options include:
+
+
+* specifying the folder where the output files are created
+* specifying which tables to dump or which tables to exclude
+* merging partial .ttx files with existing .ttf or .otf files
+* listing brief table info instead of dumping to .ttx
+* splitting tables to separate .ttx files
+* disabling TrueType instruction disassembly
+
+The TTX file format
+^^^^^^^^^^^^^^^^^^^
+
+.. begin table list
+
+The following tables are currently supported::
+
+ BASE, CBDT, CBLC, CFF, CFF2, COLR, CPAL, DSIG, Debg, EBDT, EBLC,
+ FFTM, Feat, GDEF, GMAP, GPKG, GPOS, GSUB, Glat, Gloc, HVAR, JSTF,
+ LTSH, MATH, META, MVAR, OS/2, SING, STAT, SVG, Silf, Sill, TSI0,
+ TSI1, TSI2, TSI3, TSI5, TSIB, TSIC, TSID, TSIJ, TSIP, TSIS, TSIV,
+ TTFA, VDMX, VORG, VVAR, ankr, avar, bsln, cidg, cmap, cvar, cvt,
+ feat, fpgm, fvar, gasp, gcid, glyf, gvar, hdmx, head, hhea, hmtx,
+ kern, lcar, loca, ltag, maxp, meta, mort, morx, name, opbd, post,
+ prep, prop, sbix, trak, vhea and vmtx
+
+.. end table list
+
+Other tables are dumped as hexadecimal data.
+
+TrueType fonts use glyph indices (GlyphIDs) to refer to glyphs in most places. While this is fine in binary form, it is really hard to work with for humans. Therefore we use names instead.
+
+The glyph names are either extracted from the ``CFF`` table or the ``post`` table, or are derived from a Unicode ``cmap`` table. In the latter case the Adobe Glyph List is used to calculate names based on Unicode values. If all of these methods fail, names are invented based on GlyphID (eg ``glyph00142``)
+
+It is possible that different glyphs use the same name. If this happens, we force the names to be unique by appending #n to the name (n being an integer number.) The original names are being kept, so this has no influence on a "round tripped" font.
+
+Because the order in which glyphs are stored inside the binary font is important, we maintain an ordered list of glyph names in the font.
+
.. automodule:: fontTools.ttx
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/ufoLib/converters.rst b/Doc/source/ufoLib/converters.rst
index 74aafbf8..2b37e56a 100644
--- a/Doc/source/ufoLib/converters.rst
+++ b/Doc/source/ufoLib/converters.rst
@@ -1,9 +1,9 @@
-.. highlight:: python
-==========
+##########
converters
-==========
+##########
-.. automodule:: ufoLib.converters
+.. automodule:: fontTools.ufoLib.converters
:inherited-members:
:members:
+ :undoc-members:
diff --git a/Doc/source/ufoLib/errors.rst b/Doc/source/ufoLib/errors.rst
new file mode 100644
index 00000000..ba079abd
--- /dev/null
+++ b/Doc/source/ufoLib/errors.rst
@@ -0,0 +1,9 @@
+
+######
+errors
+######
+
+.. automodule:: fontTools.ufoLib.errors
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/ufoLib/filenames.rst b/Doc/source/ufoLib/filenames.rst
index d604c4c5..33a3c1b7 100644
--- a/Doc/source/ufoLib/filenames.rst
+++ b/Doc/source/ufoLib/filenames.rst
@@ -1,9 +1,9 @@
-.. highlight:: python
-=========
+#########
filenames
-=========
+#########
-.. automodule:: ufoLib.filenames
+.. automodule:: fontTools.ufoLib.filenames
:inherited-members:
:members:
+ :undoc-members:
diff --git a/Doc/source/ufoLib/glifLib.rst b/Doc/source/ufoLib/glifLib.rst
index ffe4672f..15bde5ab 100644
--- a/Doc/source/ufoLib/glifLib.rst
+++ b/Doc/source/ufoLib/glifLib.rst
@@ -1,9 +1,9 @@
-.. highlight:: python
-=======
+#######
glifLib
-=======
+#######
-.. automodule:: ufoLib.glifLib
+.. automodule:: fontTools.ufoLib.glifLib
:inherited-members:
:members:
+ :undoc-members:
diff --git a/Doc/source/ufoLib/index.rst b/Doc/source/ufoLib/index.rst
new file mode 100644
index 00000000..514c5c9f
--- /dev/null
+++ b/Doc/source/ufoLib/index.rst
@@ -0,0 +1,22 @@
+
+######
+ufoLib
+######
+
+.. toctree::
+ :maxdepth: 1
+
+ converters
+ errors
+ filenames
+ glifLib
+ kerning
+ plistlib
+ pointpen
+ utils
+ validators
+
+.. automodule:: fontTools.ufoLib
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/ufoLib/kerning.rst b/Doc/source/ufoLib/kerning.rst
new file mode 100644
index 00000000..4d9d0c15
--- /dev/null
+++ b/Doc/source/ufoLib/kerning.rst
@@ -0,0 +1,9 @@
+
+#######
+kerning
+#######
+
+.. automodule:: fontTools.ufoLib.kerning
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/ufoLib/plistlib.rst b/Doc/source/ufoLib/plistlib.rst
new file mode 100644
index 00000000..d639947c
--- /dev/null
+++ b/Doc/source/ufoLib/plistlib.rst
@@ -0,0 +1,9 @@
+
+########
+plistlib
+########
+
+.. automodule:: fontTools.ufoLib.plistlib
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/ufoLib/pointPen.rst b/Doc/source/ufoLib/pointPen.rst
deleted file mode 100644
index 6cb1ca17..00000000
--- a/Doc/source/ufoLib/pointPen.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-.. highlight:: python
-
-========
-pointPen
-========
-
-.. automodule:: ufoLib.pointPen
- :inherited-members:
- :members:
diff --git a/Doc/source/ufoLib/pointpen.rst b/Doc/source/ufoLib/pointpen.rst
new file mode 100644
index 00000000..5fb8c1ca
--- /dev/null
+++ b/Doc/source/ufoLib/pointpen.rst
@@ -0,0 +1,9 @@
+
+########
+pointPen
+########
+
+.. automodule:: fontTools.ufoLib.pointPen
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/ufoLib/ufoLib.rst b/Doc/source/ufoLib/ufoLib.rst
deleted file mode 100644
index 3b3b0b1a..00000000
--- a/Doc/source/ufoLib/ufoLib.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-.. highlight:: python
-
-======
-ufoLib
-======
-
-.. automodule:: ufoLib
- :inherited-members:
- :members:
diff --git a/Doc/source/ufoLib/utils.rst b/Doc/source/ufoLib/utils.rst
new file mode 100644
index 00000000..d5ab143e
--- /dev/null
+++ b/Doc/source/ufoLib/utils.rst
@@ -0,0 +1,9 @@
+
+#####
+utils
+#####
+
+.. automodule:: fontTools.ufoLib.utils
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/ufoLib/validators.rst b/Doc/source/ufoLib/validators.rst
new file mode 100644
index 00000000..363d8648
--- /dev/null
+++ b/Doc/source/ufoLib/validators.rst
@@ -0,0 +1,9 @@
+
+##########
+validators
+##########
+
+.. automodule:: fontTools.ufoLib.validators
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/unicode.rst b/Doc/source/unicode.rst
new file mode 100644
index 00000000..65481d58
--- /dev/null
+++ b/Doc/source/unicode.rst
@@ -0,0 +1,8 @@
+#######
+unicode
+#######
+
+.. automodule:: fontTools.unicode
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/unicodedata/Blocks.rst b/Doc/source/unicodedata/Blocks.rst
new file mode 100644
index 00000000..5d01da7e
--- /dev/null
+++ b/Doc/source/unicodedata/Blocks.rst
@@ -0,0 +1,13 @@
+######
+Blocks
+######
+
+.. automodule:: fontTools.unicodedata.Blocks
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+.. data:: fontTools.unicodedata.Blocks.RANGES
+
+.. data:: fontTools.unicodedata.Blocks.VALUES
+
diff --git a/Doc/source/unicodedata/OTTags.rst b/Doc/source/unicodedata/OTTags.rst
new file mode 100644
index 00000000..a436bdc4
--- /dev/null
+++ b/Doc/source/unicodedata/OTTags.rst
@@ -0,0 +1,17 @@
+######
+OTTags
+######
+
+.. automodule:: fontTools.unicodedata.OTTags
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+.. data:: fontTools.unicodedata.OTTags.DEFAULT_SCRIPT
+
+.. data:: fontTools.unicodedata.OTTags.SCRIPT_EXCEPTIONS
+
+.. data:: fontTools.unicodedata.OTTags.NEW_SCRIPT_TAGS
+
+.. data:: fontTools.unicodedata.OTTags.NEW_SCRIPT_TAGS_REVERSED
+
diff --git a/Doc/source/unicodedata/ScriptExtensions.rst b/Doc/source/unicodedata/ScriptExtensions.rst
new file mode 100644
index 00000000..dce2bbc4
--- /dev/null
+++ b/Doc/source/unicodedata/ScriptExtensions.rst
@@ -0,0 +1,12 @@
+################
+ScriptExtensions
+################
+
+.. automodule:: fontTools.unicodedata.ScriptExtensions
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+.. data:: fontTools.unicodedata.ScriptExtensions.RANGES
+
+.. data:: fontTools.unicodedata.ScriptExtensions.VALUES
diff --git a/Doc/source/unicodedata/Scripts.rst b/Doc/source/unicodedata/Scripts.rst
new file mode 100644
index 00000000..2ec6e341
--- /dev/null
+++ b/Doc/source/unicodedata/Scripts.rst
@@ -0,0 +1,16 @@
+#######
+Scripts
+#######
+
+.. automodule:: fontTools.unicodedata.Scripts
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+.. data:: fontTools.unicodedata.Scripts.NAMES
+
+.. data:: fontTools.unicodedata.Scripts.RANGES
+
+.. data:: fontTools.unicodedata.Scripts.VALUES
+
+
diff --git a/Doc/source/unicodedata/index.rst b/Doc/source/unicodedata/index.rst
new file mode 100644
index 00000000..811d65d7
--- /dev/null
+++ b/Doc/source/unicodedata/index.rst
@@ -0,0 +1,16 @@
+###########
+unicodedata
+###########
+
+.. toctree::
+ :maxdepth: 1
+
+ Blocks
+ OTTags
+ ScriptExtensions
+ Scripts
+
+.. automodule:: fontTools.unicodedata
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/varLib/builder.rst b/Doc/source/varLib/builder.rst
new file mode 100644
index 00000000..3da3d32c
--- /dev/null
+++ b/Doc/source/varLib/builder.rst
@@ -0,0 +1,8 @@
+#######
+builder
+#######
+
+.. automodule:: fontTools.varLib.builder
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/varLib/cff.rst b/Doc/source/varLib/cff.rst
new file mode 100644
index 00000000..62e11c73
--- /dev/null
+++ b/Doc/source/varLib/cff.rst
@@ -0,0 +1,8 @@
+###
+cff
+###
+
+.. automodule:: fontTools.varLib.cff
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/varLib/designspace.rst b/Doc/source/varLib/designspace.rst
deleted file mode 100644
index e3bbdf7c..00000000
--- a/Doc/source/varLib/designspace.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-###########
-designspace
-###########
-
-.. automodule:: fontTools.varLib.designspace
- :members:
- :undoc-members:
diff --git a/Doc/source/varLib/errors.rst b/Doc/source/varLib/errors.rst
new file mode 100644
index 00000000..b761854c
--- /dev/null
+++ b/Doc/source/varLib/errors.rst
@@ -0,0 +1,8 @@
+######
+errors
+######
+
+.. automodule:: fontTools.varLib.errors
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/varLib/featureVars.rst b/Doc/source/varLib/featureVars.rst
new file mode 100644
index 00000000..da73560f
--- /dev/null
+++ b/Doc/source/varLib/featureVars.rst
@@ -0,0 +1,8 @@
+###########
+featureVars
+###########
+
+.. automodule:: fontTools.varLib.featureVars
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/varLib/index.rst b/Doc/source/varLib/index.rst
index 0e9f17b8..7b224967 100644
--- a/Doc/source/varLib/index.rst
+++ b/Doc/source/varLib/index.rst
@@ -1,17 +1,114 @@
-######
-varLib
-######
+##################################
+varLib: OpenType Variation Support
+##################################
+
+The ``fontTools.varLib`` package contains a number of classes and routines
+for handling, building and interpolating variable font data. These routines
+rely on a common set of concepts, many of which are equivalent to concepts
+in the OpenType Specification, but some of which are unique to ``varLib``.
+
+Terminology
+-----------
+
+axis
+ "A designer-determined variable in a font face design that can be used to
+ derive multiple, variant designs within a family." (OpenType Specification)
+ An axis has a minimum value, a maximum value and a default value.
+
+designspace
+ The n-dimensional space formed by the font's axes. (OpenType Specification
+ calls this the "design-variation space")
+
+scalar
+ A value which is able to be varied at different points in the designspace:
+ for example, the horizontal advance width of the glyph "a" is a scalar.
+ However, see also *support scalar* below.
+
+default location
+ A point in the designspace whose coordinates are the default value of
+ all axes.
+
+location
+ A point in the designspace, specified as a set of coordinates on one or
+ more axes. In the context of ``varLib``, a location is a dictionary with
+ the keys being the axis tags and the values being the coordinates on the
+ respective axis. A ``varLib`` location dictionary may be "sparse", in the
+ sense that axes defined in the font may be omitted from the location's
+ coordinates, in which case the default value of the axis is assumed.
+ For example, given a font having a ``wght`` axis ranging from 200-1000
+ with default 400, and a ``wdth`` axis ranging 100-300 with default 150,
+ the location ``{"wdth": 200}`` represents the point ``wght=400,wdth=200``.
+
+master
+ The value of a scalar at a given location. **Note that this is a
+ considerably more general concept than the usual type design sense of
+ the term "master".**
+
+normalized location
+ While the range of an axis is determined by its minimum and maximum values
+ as set by the designer, locations are specified internally to the font binary
+ in the range -1 to 1, with 0 being the default, -1 being the minimum and
+ 1 being the maximum. A normalized location is one which is scaled to the
+ range (-1,1) on all of its axes. Note that as the range from minimum to
+ default and from default to maximum on a given axis may differ (for
+ example, given ``wght min=200 default=500 max=1000``, the difference
+ between a normalized location -1 of a normalized location of 0 represents a
+ difference of 300 units while the difference between a normalized location
+ of 0 and a normalized location of 1 represents a difference of 700 units),
+ a location is scaled by a different factor depending on whether it is above
+ or below the axis' default value.
+
+support
+ While designers tend to think in terms of masters - that is, a precise
+ location having a particular value - OpenType Variations specifies the
+ variation of scalars in terms of deltas which are themselves composed of
+ the combined contributions of a set of triangular regions, each having
+ a contribution value of 0 at its minimum value, rising linearly to its
+ full contribution at the *peak* and falling linearly to zero from the
+ peak to the maximum value. The OpenType Specification calls these "regions",
+ while ``varLib`` calls them "supports" (a mathematical term used in real
+ analysis) and expresses them as a dictionary mapping each axis tag to a
+ tuple ``(min, peak, max)``.
+
+box
+ ``varLib`` uses the term "box" to denote the minimum and maximum "corners" of
+ a support, ignoring its peak value.
+
+delta
+ The term "delta" is used in OpenType Variations in two senses. In the
+ more general sense, a delta is the difference between a scalar at a
+ given location and its value at the default location. Additionally, inside
+ the font, variation data is stored as a mapping between supports and deltas.
+ The delta (in the first sense) is computed by summing the product of the
+ delta of each support by a factor representing the support's contribution
+ at this location (see "support scalar" below).
+
+support scalar
+ When interpolating a set of variation data, the support scalar represents
+ the scalar multiplier of the support's contribution at this location. For
+ example, the support scalar will be 1 at the support's peak location, and
+ 0 below its minimum or above its maximum.
+
.. toctree::
:maxdepth: 2
- designspace
+ builder
+ cff
+ errors
+ featureVars
+ instancer
interpolatable
interpolate_layout
+ iup
merger
models
mutator
+ mvar
+ plot
+ varStore
.. automodule:: fontTools.varLib
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/varLib/instancer.rst b/Doc/source/varLib/instancer.rst
new file mode 100644
index 00000000..8776de31
--- /dev/null
+++ b/Doc/source/varLib/instancer.rst
@@ -0,0 +1,8 @@
+#########
+instancer
+#########
+
+.. automodule:: fontTools.varLib.instancer
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/varLib/interpolatable.rst b/Doc/source/varLib/interpolatable.rst
index 969fb614..1120a982 100644
--- a/Doc/source/varLib/interpolatable.rst
+++ b/Doc/source/varLib/interpolatable.rst
@@ -3,5 +3,6 @@ interpolatable
##############
.. automodule:: fontTools.varLib.interpolatable
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/varLib/interpolate_layout.rst b/Doc/source/varLib/interpolate_layout.rst
index 752f748b..a9655b53 100644
--- a/Doc/source/varLib/interpolate_layout.rst
+++ b/Doc/source/varLib/interpolate_layout.rst
@@ -3,5 +3,6 @@ interpolate_layout
##################
.. automodule:: fontTools.varLib.interpolate_layout
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/varLib/iup.rst b/Doc/source/varLib/iup.rst
new file mode 100644
index 00000000..b096788b
--- /dev/null
+++ b/Doc/source/varLib/iup.rst
@@ -0,0 +1,8 @@
+###
+iup
+###
+
+.. automodule:: fontTools.varLib.iup
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/varLib/merger.rst b/Doc/source/varLib/merger.rst
index 37383aa6..cf0a5a1c 100644
--- a/Doc/source/varLib/merger.rst
+++ b/Doc/source/varLib/merger.rst
@@ -3,5 +3,6 @@ merger
######
.. automodule:: fontTools.varLib.merger
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/varLib/models.rst b/Doc/source/varLib/models.rst
index e6c7fa8a..f59f0b84 100644
--- a/Doc/source/varLib/models.rst
+++ b/Doc/source/varLib/models.rst
@@ -3,5 +3,6 @@ models
######
.. automodule:: fontTools.varLib.models
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/varLib/mutator.rst b/Doc/source/varLib/mutator.rst
index e606ab86..fffa8038 100644
--- a/Doc/source/varLib/mutator.rst
+++ b/Doc/source/varLib/mutator.rst
@@ -3,5 +3,6 @@ mutator
#######
.. automodule:: fontTools.varLib.mutator
+ :inherited-members:
:members:
:undoc-members:
diff --git a/Doc/source/varLib/mvar.rst b/Doc/source/varLib/mvar.rst
new file mode 100644
index 00000000..8c59a310
--- /dev/null
+++ b/Doc/source/varLib/mvar.rst
@@ -0,0 +1,10 @@
+####
+mvar
+####
+
+.. automodule:: fontTools.varLib.mvar
+ :inherited-members:
+ :members:
+ :undoc-members:
+
+.. data:: fontTools.varLib.mvar.MVAR_ENTRIES \ No newline at end of file
diff --git a/Doc/source/varLib/plot.rst b/Doc/source/varLib/plot.rst
new file mode 100644
index 00000000..a722a2d6
--- /dev/null
+++ b/Doc/source/varLib/plot.rst
@@ -0,0 +1,8 @@
+####
+plot
+####
+
+.. automodule:: fontTools.varLib.plot
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/varLib/varStore.rst b/Doc/source/varLib/varStore.rst
new file mode 100644
index 00000000..cc91101e
--- /dev/null
+++ b/Doc/source/varLib/varStore.rst
@@ -0,0 +1,8 @@
+########
+varStore
+########
+
+.. automodule:: fontTools.varLib.varStore
+ :inherited-members:
+ :members:
+ :undoc-members:
diff --git a/Doc/source/voltLib.rst b/Doc/source/voltLib.rst
index 5906c4c2..7695db7b 100644
--- a/Doc/source/voltLib.rst
+++ b/Doc/source/voltLib.rst
@@ -3,6 +3,7 @@ voltLib
#######
.. automodule:: fontTools.voltLib
+ :inherited-members:
:members:
:undoc-members:
@@ -10,6 +11,7 @@ ast
---
.. automodule:: fontTools.voltLib.ast
+ :inherited-members:
:members:
:undoc-members:
@@ -17,6 +19,7 @@ error
-----
.. automodule:: fontTools.voltLib.parser
+ :inherited-members:
:members:
:undoc-members:
@@ -24,6 +27,7 @@ lexer
-----
.. automodule:: fontTools.voltLib.lexer
+ :inherited-members:
:members:
:undoc-members:
@@ -31,5 +35,6 @@ parser
------
.. automodule:: fontTools.voltLib.parser
+ :inherited-members:
:members:
:undoc-members: