diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 000000000..6da5104c4 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,27 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +build: + image: latest + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: Doc/source/conf.py + fail_on_warning: false + +# Optionally build your docs in additional formats such as PDF and ePub +formats: all + +# Optionally set the version of Python and requirements required to build your docs +python: + version: 3.8 + install: + - requirements: Doc/docs-requirements.txt + - method: pip + path: . + extra_requirements: + - all \ No newline at end of file diff --git a/Doc/README.md b/Doc/README.md new file mode 100644 index 000000000..26641b722 --- /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 000000000..c142c9656 --- /dev/null +++ b/Doc/docs-requirements.txt @@ -0,0 +1,2 @@ +sphinx == 3.0.2 +sphinx_rtd_theme == 0.4.3 diff --git a/Doc/source/afmLib.rst b/Doc/source/afmLib.rst index f56d3c1b9..b9c419fe0 100644 --- a/Doc/source/afmLib.rst +++ b/Doc/source/afmLib.rst @@ -3,5 +3,6 @@ afmLib ###### .. automodule:: fontTools.afmLib + :inherited-members: :members: :undoc-members: diff --git a/Doc/source/agl.rst b/Doc/source/agl.rst index 0ecf14d0b..84fb56fab 100644 --- a/Doc/source/agl.rst +++ b/Doc/source/agl.rst @@ -3,5 +3,6 @@ agl ### .. automodule:: fontTools.agl + :inherited-members: :members: :undoc-members: diff --git a/Doc/source/assets/img/favicon.ico b/Doc/source/assets/img/favicon.ico new file mode 100755 index 000000000..f55a275d9 Binary files /dev/null and b/Doc/source/assets/img/favicon.ico differ diff --git a/Doc/source/cffLib.rst b/Doc/source/cffLib/index.rst similarity index 52% rename from Doc/source/cffLib.rst rename to Doc/source/cffLib/index.rst index 364824f45..be8073e39 100644 --- a/Doc/source/cffLib.rst +++ b/Doc/source/cffLib/index.rst @@ -2,6 +2,13 @@ cffLib ###### +.. toctree:: + :maxdepth: 1 + + specializer + width + .. automodule:: fontTools.cffLib + :inherited-members: :members: :undoc-members: diff --git a/Doc/source/cffLib/specializer.rst b/Doc/source/cffLib/specializer.rst new file mode 100644 index 000000000..1d6645c71 --- /dev/null +++ b/Doc/source/cffLib/specializer.rst @@ -0,0 +1,8 @@ +########### +specializer +########### + +.. 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 000000000..704a9aa4e --- /dev/null +++ b/Doc/source/cffLib/width.rst @@ -0,0 +1,8 @@ +##### +width +##### + +.. automodule:: fontTools.cffLib.width + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/colorLib/builder.rst b/Doc/source/colorLib/builder.rst new file mode 100644 index 000000000..94170f1d7 --- /dev/null +++ b/Doc/source/colorLib/builder.rst @@ -0,0 +1,8 @@ +####### +builder +####### + +.. automodule:: fontTools.colorLib.builder + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/colorLib/errors.rst b/Doc/source/colorLib/errors.rst new file mode 100644 index 000000000..c06224b23 --- /dev/null +++ b/Doc/source/colorLib/errors.rst @@ -0,0 +1,8 @@ +###### +errors +###### + +.. automodule:: fontTools.colorLib.errors + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/colorLib/index.rst b/Doc/source/colorLib/index.rst new file mode 100644 index 000000000..06721beac --- /dev/null +++ b/Doc/source/colorLib/index.rst @@ -0,0 +1,14 @@ +######## +colorLib +######## + +.. toctree:: + :maxdepth: 1 + + builder + errors + +.. automodule:: fontTools.colorLib + :inherited-members: + :members: + :undoc-members: \ No newline at end of file diff --git a/Doc/source/conf.py b/Doc/source/conf.py index a3b2be2a3..e0ee7a936 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"] -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/cli.rst b/Doc/source/cu2qu/cli.rst new file mode 100644 index 000000000..798b49f27 --- /dev/null +++ b/Doc/source/cu2qu/cli.rst @@ -0,0 +1,8 @@ +### +cli +### + +.. automodule:: fontTools.cu2qu.cli + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/cu2qu/cu2qu.rst b/Doc/source/cu2qu/cu2qu.rst new file mode 100644 index 000000000..73f95c96f --- /dev/null +++ b/Doc/source/cu2qu/cu2qu.rst @@ -0,0 +1,8 @@ +##### +cu2qu +##### + +.. automodule:: fontTools.cu2qu.cu2qu + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/cu2qu/errors.rst b/Doc/source/cu2qu/errors.rst new file mode 100644 index 000000000..679c75145 --- /dev/null +++ b/Doc/source/cu2qu/errors.rst @@ -0,0 +1,8 @@ +###### +errors +###### + +.. automodule:: fontTools.cu2qu.errors + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/cu2qu/index.rst b/Doc/source/cu2qu/index.rst new file mode 100644 index 000000000..d8c00310e --- /dev/null +++ b/Doc/source/cu2qu/index.rst @@ -0,0 +1,16 @@ +##### +cu2qu +##### + +.. toctree:: + :maxdepth: 1 + + cli + cu2qu + errors + ufo + +.. automodule:: fontTools.cu2qu + :inherited-members: + :members: + :undoc-members: \ No newline at end of file diff --git a/Doc/source/cu2qu/ufo.rst b/Doc/source/cu2qu/ufo.rst new file mode 100644 index 000000000..ef66e74b5 --- /dev/null +++ b/Doc/source/cu2qu/ufo.rst @@ -0,0 +1,8 @@ +### +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 2fb4e5288..2c33df7bc 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/encodings/StandardEncoding.rst b/Doc/source/encodings/StandardEncoding.rst new file mode 100644 index 000000000..4c936c05c --- /dev/null +++ b/Doc/source/encodings/StandardEncoding.rst @@ -0,0 +1,10 @@ +################ +StandardEncoding +################ + +.. automodule:: fontTools.encodings.StandardEncoding + :inherited-members: + :members: + :undoc-members: + +.. data:: fontTools.encodings.StandardEncoding.StandardEncoding diff --git a/Doc/source/encodings/codecs.rst b/Doc/source/encodings/codecs.rst new file mode 100644 index 000000000..ea0b03e9a --- /dev/null +++ b/Doc/source/encodings/codecs.rst @@ -0,0 +1,8 @@ +###### +codecs +###### + +.. automodule:: fontTools.encodings.codecs + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/encodings.rst b/Doc/source/encodings/index.rst similarity index 51% rename from Doc/source/encodings.rst rename to Doc/source/encodings/index.rst index 8bcd38a23..6de20f4f7 100644 --- a/Doc/source/encodings.rst +++ b/Doc/source/encodings/index.rst @@ -2,13 +2,16 @@ encodings ######### +.. toctree:: + :maxdepth: 1 + + codecs + macRoman + StandardEncoding + + .. automodule:: fontTools.encodings + :inherited-members: :members: :undoc-members: -codecs ------- - -.. automodule:: fontTools.encodings.codecs - :members: - :undoc-members: diff --git a/Doc/source/encodings/macRoman.rst b/Doc/source/encodings/macRoman.rst new file mode 100644 index 000000000..b56d5e754 --- /dev/null +++ b/Doc/source/encodings/macRoman.rst @@ -0,0 +1,10 @@ +######## +MacRoman +######## + +.. automodule:: fontTools.encodings.MacRoman + :inherited-members: + :members: + :undoc-members: + +.. data:: fontTools.encodings.MacRoman.MacRoman diff --git a/Doc/source/feaLib.rst b/Doc/source/feaLib.rst deleted file mode 100644 index ad69217cd..000000000 --- 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/ast.rst b/Doc/source/feaLib/ast.rst new file mode 100644 index 000000000..6804299e8 --- /dev/null +++ b/Doc/source/feaLib/ast.rst @@ -0,0 +1,8 @@ +### +ast +### + +.. automodule:: fontTools.feaLib.ast + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/feaLib/builder.rst b/Doc/source/feaLib/builder.rst new file mode 100644 index 000000000..8acbeada4 --- /dev/null +++ b/Doc/source/feaLib/builder.rst @@ -0,0 +1,8 @@ +####### +builder +####### + +.. automodule:: fontTools.feaLib.builder + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/feaLib/error.rst b/Doc/source/feaLib/error.rst new file mode 100644 index 000000000..fa85e0f59 --- /dev/null +++ b/Doc/source/feaLib/error.rst @@ -0,0 +1,8 @@ +##### +error +##### + +.. automodule:: fontTools.feaLib.error + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/feaLib/index.rst b/Doc/source/feaLib/index.rst new file mode 100644 index 000000000..363761db8 --- /dev/null +++ b/Doc/source/feaLib/index.rst @@ -0,0 +1,17 @@ +###### +feaLib +###### + +.. toctree:: + :maxdepth: 1 + + ast + builder + error + lexer + parser + +.. automodule:: fontTools.feaLib + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/feaLib/lexer.rst b/Doc/source/feaLib/lexer.rst new file mode 100644 index 000000000..939abf7ef --- /dev/null +++ b/Doc/source/feaLib/lexer.rst @@ -0,0 +1,8 @@ +##### +lexer +##### + +.. automodule:: fontTools.feaLib.lexer + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/feaLib/parser.rst b/Doc/source/feaLib/parser.rst new file mode 100644 index 000000000..2d5a61245 --- /dev/null +++ b/Doc/source/feaLib/parser.rst @@ -0,0 +1,8 @@ +###### +parser +###### + +.. automodule:: fontTools.feaLib.parser + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/index.rst b/Doc/source/index.rst index b3d44cf03..32f029590 100644 --- a/Doc/source/index.rst +++ b/Doc/source/index.rst @@ -1,28 +1,355 @@ +.. image:: ../../Icons/FontToolsIconGreenCircle.png + :width: 200px + :height: 200px + :alt: Font Tools + :align: center + + fontTools Docs ============== +|Travis Build Status| |Appveyor Build status| |Coverage Status| |PyPI| |Gitter Chat| + +About +----- + + +fontTools is a library for manipulating fonts, written in Python. The project includes the TTX tool, that can convert TrueType and OpenType fonts to and from an XML text format, which is also called TTX. It supports TrueType, OpenType, AFM and to an extent Type 1 and some Mac-specific formats. The project has an `MIT open-source license `_. Among other things this means you can use it free of charge. + +Installation +------------ + +.. note:: + + fontTools requires `Python `_ 3.6 or later. + +The package is listed in the Python Package Index (PyPI), so you can install it with `pip `_:: + + pip install fonttools + +If you would like to contribute to its development, you can clone the repository from GitHub, install the package in 'editable' mode and modify the source code in place. We recommend creating a virtual environment, using the Python 3 `venv `_ 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``. + +See the Optional Requirements section below for details about module-specific dependencies that must be installed in select cases. + + +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 +^^^^^^^^^^^^^^^^^^^ + +The following tables are currently supported:: + + BASE, CBDT, CBLC, CFF, CFF2, COLR, CPAL, DSIG, 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, 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 + +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. + +Please see the :py:mod:`fontTools.ttx` documentation for additional details. + + +Other Tools +----------- + +Commands for inspecting, merging and subsetting fonts are also available:: + + pyftinspect + pyftmerge + pyftsubset + +Please see the :py:mod:`fontTools.inspect`, :py:mod:`fontTools.merge`, and :py:mod:`fontTools.subset` documentation for additional information about these tools. + + +fontTools Python Library +------------------------ + +The fontTools Python library provides a convenient way to programmatically edit font files:: + + >>> from fontTools.ttLib import TTFont + >>> font = TTFont('/path/to/font.ttf') + >>> font + + >>> + +A selection of sample Python programs is in the `Snippets directory `_ of the fontTools repository. + +Please navigate to the respective area of the documentation to learn more about the available modules in the fontTools library. + + +Optional Requirements +--------------------- + +.. note:: + + Additional dependencies are required by some of the fontTools modules to unlock optional features. The list below details these optional dependencies. + + +inspect Module +^^^^^^^^^^^^^^ + +:py:mod:`fontTools.inspect` +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A GUI font inspector, requires one of the following packages: + +* `PyGTK `_: Python bindings for GTK 2.x (only works with Python 2) +* `PyGObject `_ : Python bindings for GTK 3.x and gobject-introspection libraries (also compatible with Python 3) + + + +misc Module +^^^^^^^^^^^ + +:py:mod:`fontTools.misc.symfont` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Advanced module for symbolic font statistics analysis; it requires: + +* `sympy `_: the Python library for symbolic mathematics + + + +pens Modules +^^^^^^^^^^^^ + +:py:mod:`fontTools.pens.cocoaPen` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Pen for drawing glyphs with Cocoa ``NSBezierPath``, requires: + +* `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 `_: 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 `_: Python toolkit for generating PDFs and graphics + + + +t1Lib Module +^^^^^^^^^^^^ + +:py:mod:`fontTools.t1Lib` +^^^^^^^^^^^^^^^^^^^^^^^^^ + +To get the file creator and type of Apple PostScript Type 1 fonts on Python 3 you need to install the following module, as the old macOS module is no longer included in macOS Python: + +* `xattr `_: Python wrapper for extended filesystem attributes (macOS platform only) + + + +ttLib Modules +^^^^^^^^^^^^^ + +:py:mod:`fontTools.ttLib.woff2` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Module to compress/decompress WOFF 2.0 web fonts; it requires: + +* `brotli `_: Python bindings of the Brotli compression library. + + +:py:mod:`fontTools.ttLib.sfnt` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To better compress WOFF 1.0 web fonts, the following module can be used instead of the built-in zlib library: + +* `zopfli `_: Python bindings of the Zopfli compression library + + +ufoLib Module +^^^^^^^^^^^^^ + +:py:mod:`fontTools.ufoLib` +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Package for reading and writing UFO source files; it requires: + +* `fs `_: (aka ``pyfilesystem2``) filesystem abstraction layer +* `enum34 `_: backport for the built-in enum module (only required on Python < 3.4) + + +unicode Module +^^^^^^^^^^^^^^ + +: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 `_: unicodedata backport for Python 2.7 and 3.5 updated to the latest Unicode version 9.0. Note this is not necessary if you use Python 3.6 as the latter already comes with an up-to-date unicodedata. + + +varLib Module +^^^^^^^^^^^^^ + +: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 `_: the Scientific Library for Python, which internally uses `NumPy `_ arrays and hence is very fast +* `munkres `_: a pure-Python module that implements the Hungarian or Kuhn-Munkres algorithm + + +Testing +------- + +To run the test suite, use:: + + python setup.py test + +If you have `pytest `_, you can run the pytest command directly. The tests will run against the installed fontTools package, or the first one found in the ``PYTHONPATH``. + +You can also use `tox `_ to automatically run tests on different Python versions in isolated virtual environments:: + + pip install tox + tox + + + +.. note:: + + When you run ``tox`` without arguments, the tests are executed for all the environments listed in the ``tox.ini`` ``envlist``. The current Python interpreters defined for tox testing must be available on your system ``PATH``. + +You can specify a different testing environment list via the ``-e`` option, or the ``TOXENV`` environment variable:: + + tox -e py27-nocov + 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 `_. There is also a development https://groups.google.com/d/forum/fonttools-dev mailing list for continuous integration notifications. + + +Acknowledgments +--------------- + +In alphabetical order: + +Olivier Berten, Samyak Bhuta, Erik van Blokland, Petr van Blokland, Jelle Bosma, Sascha Brawer, Tom Byrer, Frédéric Coiffier, Vincent Connare, Dave Crossland, Simon Daniels, Behdad Esfahbod, Behnam Esfahbod, Hannes Famira, Sam Fishman, Matt Fontaine, Yannis Haralambous, Greg Hitchcock, Jeremie Hornus, Khaled Hosny, John Hudson, Denis Moyogo Jacquerye, Jack Jansen, Tom Kacvinsky, Jens Kutilek, Antoine Leca, Werner Lemberg, Tal Leming, Peter Lofting, Cosimo Lupo, Masaya Nakamura, Dave Opstad, Laurence Penney, Roozbeh Pournader, Garret Rieger, Read Roberts, Guido van Rossum, Just van Rossum, Andreas Seidel, Georg Seifert, Miguel Sousa, Adam Twardoch, Adrien Tétar, Vitaly Volkov, Paul Wise + + +License +------- + +`MIT 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 74cf9ade3..2fd85ef28 100644 --- a/Doc/source/merge.rst +++ b/Doc/source/merge.rst @@ -3,5 +3,6 @@ merge ##### .. automodule:: fontTools.merge + :inherited-members: :members: :undoc-members: diff --git a/Doc/source/misc/arrayTools.rst b/Doc/source/misc/arrayTools.rst index acb2a5150..7beaa7afb 100644 --- a/Doc/source/misc/arrayTools.rst +++ b/Doc/source/misc/arrayTools.rst @@ -3,5 +3,6 @@ arrayTools ########## .. automodule:: fontTools.misc.arrayTools + :inherited-members: :members: :undoc-members: diff --git a/Doc/source/misc/bezierTools.rst b/Doc/source/misc/bezierTools.rst index c5b4d2a79..a8bafe53a 100644 --- a/Doc/source/misc/bezierTools.rst +++ b/Doc/source/misc/bezierTools.rst @@ -3,5 +3,6 @@ bezierTools ########### .. automodule:: fontTools.misc.bezierTools + :inherited-members: :members: :undoc-members: diff --git a/Doc/source/misc/classifyTools.rst b/Doc/source/misc/classifyTools.rst index b02b35098..38c35d4c4 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 000000000..6e1b90e03 --- /dev/null +++ b/Doc/source/misc/cliTools.rst @@ -0,0 +1,8 @@ +######## +cliTools +######## + +.. automodule:: fontTools.misc.cliTools + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/misc/eexec.rst b/Doc/source/misc/eexec.rst index 8506f8636..53a9aa063 100644 --- a/Doc/source/misc/eexec.rst +++ b/Doc/source/misc/eexec.rst @@ -3,5 +3,6 @@ eexec ##### .. automodule:: fontTools.misc.eexec + :inherited-members: :members: :undoc-members: diff --git a/Doc/source/misc/encodingTools.rst b/Doc/source/misc/encodingTools.rst index ff29f6680..4e4b71975 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/filenames.rst b/Doc/source/misc/filenames.rst new file mode 100644 index 000000000..254911c9d --- /dev/null +++ b/Doc/source/misc/filenames.rst @@ -0,0 +1,8 @@ +######### +filenames +######### + +.. automodule:: fontTools.misc.filenames + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/misc/fixedTools.rst b/Doc/source/misc/fixedTools.rst index 30a1f028c..614262467 100644 --- a/Doc/source/misc/fixedTools.rst +++ b/Doc/source/misc/fixedTools.rst @@ -3,5 +3,6 @@ fixedTools ########## .. automodule:: fontTools.misc.fixedTools + :inherited-members: :members: :undoc-members: diff --git a/Doc/source/misc/index.rst b/Doc/source/misc/index.rst index 29a7245c4..2bb1af38a 100644 --- a/Doc/source/misc/index.rst +++ b/Doc/source/misc/index.rst @@ -8,16 +8,23 @@ misc arrayTools bezierTools classifyTools + cliTools eexec encodingTools + filenames fixedTools + macCreatorType + macRes loggingTools - sstruct psCharStrings + psLib + psOperators + py23 + sstruct + symfont testTools textTools timeTools transform xmlReader xmlWriter - diff --git a/Doc/source/misc/loggingTools.rst b/Doc/source/misc/loggingTools.rst index fb8eab582..3a7c42364 100644 --- a/Doc/source/misc/loggingTools.rst +++ b/Doc/source/misc/loggingTools.rst @@ -3,5 +3,6 @@ loggingTools ############ .. automodule:: fontTools.misc.loggingTools + :inherited-members: :members: :undoc-members: diff --git a/Doc/source/misc/macCreatorType.rst b/Doc/source/misc/macCreatorType.rst new file mode 100644 index 000000000..cf451eb83 --- /dev/null +++ b/Doc/source/misc/macCreatorType.rst @@ -0,0 +1,8 @@ +############## +macCreatorType +############## + +.. automodule:: fontTools.misc.macCreatorType + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/misc/macRes.rst b/Doc/source/misc/macRes.rst new file mode 100644 index 000000000..ff65172da --- /dev/null +++ b/Doc/source/misc/macRes.rst @@ -0,0 +1,8 @@ +###### +macRes +###### + +.. automodule:: fontTools.misc.macRes + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/misc/psCharStrings.rst b/Doc/source/misc/psCharStrings.rst index 3dc0dce3d..58497f65b 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 000000000..f3afa8bf7 --- /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 000000000..432274e6d --- /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 000000000..49a76bf16 --- /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 482aa23fe..0544795fc 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 000000000..c189f3d9d --- /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 b3215ac4f..00197656c 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 754eb6757..0044c082c 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 f8d15081a..c0a719906 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 9517fe026..44a3dbdfe 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 6e0935452..d0b80f5ba 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 f488183d4..5f7aaef5e 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 000000000..fdb35a679 --- /dev/null +++ b/Doc/source/mtiLib.rst @@ -0,0 +1,8 @@ +###### +mtiLib +###### + +.. automodule:: fontTools.mtiLib + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/otlLib/builder.rst b/Doc/source/otlLib/builder.rst new file mode 100644 index 000000000..6e4c95ee7 --- /dev/null +++ b/Doc/source/otlLib/builder.rst @@ -0,0 +1,8 @@ +####### +builder +####### + +.. automodule:: fontTools.otlLib.builder + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/otlLib/index.rst b/Doc/source/otlLib/index.rst new file mode 100644 index 000000000..01cfc36b4 --- /dev/null +++ b/Doc/source/otlLib/index.rst @@ -0,0 +1,13 @@ +###### +otlLib +###### + +.. toctree:: + :maxdepth: 2 + + builder + +.. automodule:: fontTools.otlLib + :inherited-members: + :members: + :undoc-members: diff --git a/Doc/source/pens/areaPen.rst b/Doc/source/pens/areaPen.rst index 03a751be5..f3f21bbbf 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 f5965b16c..87bf832b3 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 8de562015..a0d9ab41a 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 000000000..bbe8050ee --- /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/filterPen.rst b/Doc/source/pens/filterPen.rst index 0b484a4c1..c79b944cf 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 7e5a1926a..5dced9e27 100644 --- a/Doc/source/pens/index.rst +++ b/Doc/source/pens/index.rst @@ -5,14 +5,22 @@ pens .. toctree:: :maxdepth: 1 + areaPen basePen boundsPen - pointInsidePen + cocoaPen filterPen - transformPen - t2CharStringPen - statisticsPen - recordingPen - teePen - areaPen + momentsPen perimeterPen + pointInsidePen + qtPen + recordingPen + reverseContourPen + statisticsPen + svgPathPen + t2CharStringPen + teePen + transformPen + ttGlyphPen + wxPen + diff --git a/Doc/source/pens/momentsPen.rst b/Doc/source/pens/momentsPen.rst new file mode 100644 index 000000000..4587f75b4 --- /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 97feccaa1..c625a3dc2 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 9954e478a..81a4b2e8c 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/qtPen.rst b/Doc/source/pens/qtPen.rst new file mode 100644 index 000000000..bfaa9b506 --- /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 69e7ceb5f..ee9178c5a 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/reverseContourPen.rst b/Doc/source/pens/reverseContourPen.rst new file mode 100644 index 000000000..8178e2ca2 --- /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/statisticsPen.rst b/Doc/source/pens/statisticsPen.rst index efa16089a..e06e3220a 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 000000000..45bf15167 --- /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 d58c67aa0..9d55391f9 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 7a0313c7f..2a4558d5e 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 5b414f842..3bb802a52 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 000000000..e1bf7010f --- /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 000000000..37ce50acc --- /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 000000000..8c21c3966 --- /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 similarity index 58% rename from Doc/source/subset.rst rename to Doc/source/subset/index.rst index a8fff95e3..f32e0d42c 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 000000000..f86ff0ad4 --- /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 000000000..0d7551b9b --- /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 000000000..fc7e7ff15 --- /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 dcc04380e..4436086fd 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 d27393487..4dfa2d664 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 cb014d76f..356a911b2 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 41e303227..29566ab74 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 000000000..ca2557bf3 --- /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 6ae705fb9..7cf457798 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') + + >>> ttLib.getTableClass('glyf') + + >> + +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 000000000..0ca4ebd0d --- /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 000000000..77882cd30 --- /dev/null +++ b/Doc/source/ttLib/ttFont.rst @@ -0,0 +1,8 @@ +###### +ttFont +###### + +.. automodule:: fontTools.ttLib.ttFont + :inherited-members: + :members: + :undoc-members: \ No newline at end of file diff --git a/Doc/source/ttLib/woff2.rst b/Doc/source/ttLib/woff2.rst index 0c464be63..327bb5b26 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 1c9090150..bdc938583 100644 --- a/Doc/source/ttx.rst +++ b/Doc/source/ttx.rst @@ -3,5 +3,6 @@ ttx ### .. automodule:: fontTools.ttx + :inherited-members: :members: :undoc-members: diff --git a/Doc/source/ufoLib/converters.rst b/Doc/source/ufoLib/converters.rst index 74aafbf8a..2b37e56ac 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 000000000..ba079abd8 --- /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 d604c4c59..33a3c1b78 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 ffe4672fc..15bde5abe 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 000000000..514c5c9f7 --- /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 000000000..4d9d0c150 --- /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 000000000..d639947c3 --- /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 6cb1ca175..000000000 --- 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 000000000..5fb8c1cad --- /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 3b3b0b1aa..000000000 --- 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 000000000..d5ab143ec --- /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 000000000..363d8648a --- /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 000000000..65481d58f --- /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 000000000..5d01da7ec --- /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 000000000..a436bdc4b --- /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 000000000..dce2bbc49 --- /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 000000000..2ec6e3413 --- /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 000000000..811d65d77 --- /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 000000000..3da3d32c1 --- /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 000000000..62e11c737 --- /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 e3bbdf7cc..000000000 --- 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 000000000..b761854c7 --- /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 000000000..da73560f8 --- /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 0e9f17b8e..5394d6287 100644 --- a/Doc/source/varLib/index.rst +++ b/Doc/source/varLib/index.rst @@ -5,13 +5,22 @@ varLib .. 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 000000000..8776de313 --- /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 969fb6149..1120a982a 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 752f748b0..a9655b53b 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 000000000..b096788b4 --- /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 37383aa65..cf0a5a1c9 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 e6c7fa8ac..f59f0b84c 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 e606ab867..fffa80382 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 000000000..8c59a310d --- /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 000000000..a722a2d61 --- /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 000000000..cc91101e8 --- /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 5906c4c26..7695db7ba 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: diff --git a/MANIFEST.in b/MANIFEST.in index 152911239..37a444da8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -21,6 +21,8 @@ recursive-include .travis *.sh include Doc/Makefile include Doc/make.bat +include Doc/docs-requirements.txt +include Doc/README.md recursive-include Doc/man/man1 *.1 recursive-include Doc/source *.py *.rst diff --git a/Makefile b/Makefile index bd91d7f95..b2e3d96b7 100644 --- a/Makefile +++ b/Makefile @@ -19,4 +19,7 @@ check: all clean: ./setup.py clean --all -.PHONY: all dist install install-user uninstall check clean +docs: + cd Doc && $(MAKE) html + +.PHONY: all dist install install-user uninstall check clean docs