| 1 |
################################################# |
| 2 |
otlLib: Routines for working with OpenType Layout |
| 3 |
################################################# |
| 4 |
|
| 5 |
.. currentmodule:: fontTools.otlLib |
| 6 |
|
| 7 |
.. contents:: On this page: |
| 8 |
:local: |
| 9 |
|
| 10 |
|
| 11 |
The :mod:`fontTools.otlLib` library provides routines to help you create the |
| 12 |
subtables and other data structures you need when you are editing a font's |
| 13 |
``GSUB`` and ``GPOS`` tables: substitution and positioning rules, anchors, |
| 14 |
lookups, coverage tables and so on. |
| 15 |
|
| 16 |
------------------------------------------ |
| 17 |
High-level OpenType Layout Lookup Builders |
| 18 |
------------------------------------------ |
| 19 |
|
| 20 |
.. currentmodule:: fontTools.otlLib.builder |
| 21 |
|
| 22 |
.. autoclass:: AlternateSubstBuilder |
| 23 |
.. autoclass:: ChainContextPosBuilder |
| 24 |
.. autoclass:: ChainContextSubstBuilder |
| 25 |
.. autoclass:: LigatureSubstBuilder |
| 26 |
.. autoclass:: MultipleSubstBuilder |
| 27 |
.. autoclass:: CursivePosBuilder |
| 28 |
.. autoclass:: MarkBasePosBuilder |
| 29 |
.. autoclass:: MarkLigPosBuilder |
| 30 |
.. autoclass:: MarkMarkPosBuilder |
| 31 |
.. autoclass:: ReverseChainSingleSubstBuilder |
| 32 |
.. autoclass:: SingleSubstBuilder |
| 33 |
.. autoclass:: ClassPairPosSubtableBuilder |
| 34 |
.. autoclass:: PairPosBuilder |
| 35 |
.. autoclass:: SinglePosBuilder |
| 36 |
|
| 37 |
-------------------------------------- |
| 38 |
Common OpenType Layout Data Structures |
| 39 |
-------------------------------------- |
| 40 |
|
| 41 |
.. currentmodule:: fontTools.otlLib.builder |
| 42 |
|
| 43 |
.. autofunction:: buildCoverage |
| 44 |
.. autofunction:: buildLookup |
| 45 |
|
| 46 |
------------------------------------ |
| 47 |
Low-level GSUB Table Lookup Builders |
| 48 |
------------------------------------ |
| 49 |
|
| 50 |
These functions deal with the "simple" lookup types. See above for classes to |
| 51 |
help build more complex lookups (contextual and chaining lookups). |
| 52 |
|
| 53 |
.. currentmodule:: fontTools.otlLib.builder |
| 54 |
|
| 55 |
.. autofunction:: buildSingleSubstSubtable |
| 56 |
.. autofunction:: buildMultipleSubstSubtable |
| 57 |
.. autofunction:: buildAlternateSubstSubtable |
| 58 |
.. autofunction:: buildLigatureSubstSubtable |
| 59 |
|
| 60 |
-------------------------- |
| 61 |
GPOS Shared Table Builders |
| 62 |
-------------------------- |
| 63 |
|
| 64 |
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>`_ |
| 65 |
as defined in the OpenType spec: value records, anchors, mark arrays and |
| 66 |
mark record tables. |
| 67 |
|
| 68 |
.. currentmodule:: fontTools.otlLib.builder |
| 69 |
.. autofunction:: buildValue |
| 70 |
.. autofunction:: buildAnchor |
| 71 |
.. autofunction:: buildMarkArray |
| 72 |
.. autofunction:: buildDevice |
| 73 |
.. autofunction:: buildBaseArray |
| 74 |
.. autofunction:: buildComponentRecord |
| 75 |
|
| 76 |
------------------------------------ |
| 77 |
Low-level GPOS Table Lookup Builders |
| 78 |
------------------------------------ |
| 79 |
|
| 80 |
These functions deal with the "simple" lookup types. See above for classes to |
| 81 |
help build more complex lookups (contextual and chaining lookups). |
| 82 |
|
| 83 |
.. currentmodule:: fontTools.otlLib.builder |
| 84 |
|
| 85 |
.. autofunction:: buildCursivePosSubtable |
| 86 |
.. autofunction:: buildLigatureArray |
| 87 |
.. autofunction:: buildMarkBasePos |
| 88 |
.. autofunction:: buildMarkBasePosSubtable |
| 89 |
.. autofunction:: buildMarkLigPos |
| 90 |
.. autofunction:: buildMarkLigPosSubtable |
| 91 |
.. autofunction:: buildPairPosClassesSubtable |
| 92 |
.. autofunction:: buildPairPosGlyphs |
| 93 |
.. autofunction:: buildPairPosGlyphsSubtable |
| 94 |
.. autofunction:: buildSinglePos |
| 95 |
.. autofunction:: buildSinglePosSubtable |
| 96 |
|
| 97 |
---------------------------- |
| 98 |
GDEF Table Subtable Builders |
| 99 |
---------------------------- |
| 100 |
|
| 101 |
These functions build subtables for elements of the ``GDEF`` table. |
| 102 |
|
| 103 |
.. currentmodule:: fontTools.otlLib.builder |
| 104 |
|
| 105 |
.. autofunction:: buildAttachList |
| 106 |
.. autofunction:: buildLigCaretList |
| 107 |
.. autofunction:: buildMarkGlyphSetsDef |
| 108 |
|
| 109 |
------------------ |
| 110 |
STAT Table Builder |
| 111 |
------------------ |
| 112 |
|
| 113 |
.. currentmodule:: fontTools.otlLib.builder |
| 114 |
|
| 115 |
.. autofunction:: buildStatTable |
| 116 |
|
| 117 |
------------------ |
| 118 |
MATH Table Builder |
| 119 |
------------------ |
| 120 |
|
| 121 |
.. currentmodule:: fontTools.otlLib.builder |
| 122 |
|
| 123 |
.. autofunction:: buildMathTable |