otlLib documentation (#2009)

Document otlLib

Includes other minor changes:

* When a markFilterSet parameter is passed to a builder, LOOKUP_FLAG_USE_MARK_FILTERING_SET will be added to the lookup's flags.
* The unused arguments valueformat1 and valueformat2 were removed from ClassPairPosSubtableBuilder.
This commit is contained in:
Simon Cozens 2020-07-03 12:52:50 +01:00 committed by GitHub
commit 73631c9642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1180 additions and 105 deletions

View File

@ -1,8 +0,0 @@
#######
builder
#######
.. automodule:: fontTools.otlLib.builder
:inherited-members:
:members:
:undoc-members:

View File

@ -1,13 +1,74 @@
######
otlLib
######
#################################################
otlLib: Routines for working with OpenType Layout
#################################################
.. toctree::
:maxdepth: 2
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.
builder
------------------------------------------
High-level OpenType Layout Lookup Builders
------------------------------------------
.. automodule:: fontTools.otlLib
:inherited-members:
:members:
:undoc-members:
.. 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

File diff suppressed because it is too large Load Diff

View File

@ -201,15 +201,15 @@ 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, David Corbett, 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.
Connare, David Corbett, Simon Cozens, 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.
Copyrights
~~~~~~~~~~

View File

@ -495,14 +495,6 @@ class BuilderTest(object):
),
) as excinfo:
builder.buildLookup([s], builder.LOOKUP_FLAG_USE_MARK_FILTERING_SET, None)
with pytest.raises(
AssertionError,
match=(
"if markFilterSet is not None, flags must set "
"LOOKUP_FLAG_USE_MARK_FILTERING_SET; flags=0x0004"
),
) as excinfo:
builder.buildLookup([s], builder.LOOKUP_FLAG_IGNORE_LIGATURES, 777)
def test_buildLookup_conflictingSubtableTypes(self):
s1 = builder.buildSingleSubstSubtable({"one": "two"})