tables¶
This folder is a subpackage of 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 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.
fontTools.ttLib
provides functions to expand a tag into the format used here:
>>> from fontTools import ttLib
>>> ttLib.tagToIdentifier("FOO ")
'F_O_O_'
>>> ttLib.tagToIdentifier("cvt ")
'_c_v_t'
>>> ttLib.tagToIdentifier("OS/2")
'O_S_2f_2'
>>> ttLib.tagToIdentifier("glyf")
'_g_l_y_f'
>>>
And vice versa:
>>> ttLib.identifierToTag("F_O_O_")
'FOO '
>>> ttLib.identifierToTag("_c_v_t")
'cvt '
>>> ttLib.identifierToTag("O_S_2f_2")
'OS/2'
>>> ttLib.identifierToTag("_g_l_y_f")
'glyf'
>>>
Eg. the ‘glyf’ table converter lives in a Python file called:
_g_l_y_f.py
The converter itself is a class, named “table_” + expandedtag. Eg:
class table__g_l_y_f:
etc.
Note that if you _do_ need to use such modules or classes manually, there are two convenient API functions that let you find them by tag:
>>> ttLib.getTableModule('glyf')
<module 'ttLib.tables._g_l_y_f'>
>>> ttLib.getTableClass('glyf')
<class ttLib.tables._g_l_y_f.table__g_l_y_f at 645f400>
>>
You must subclass from 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
_a_n_k_r¶
-
class
fontTools.ttLib.tables._a_n_k_r.
table__a_n_k_r
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
subset_glyphs
(s)¶
-
toXML
(writer, font)¶
-
_a_v_a_r¶
_b_s_l_n¶
-
class
fontTools.ttLib.tables._b_s_l_n.
table__b_s_l_n
(tag=None)[source]¶ -
closure_glyphs
(s)¶
-
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
subset_glyphs
(s)¶
-
toXML
(writer, font)¶
-
_c_i_d_g¶
-
class
fontTools.ttLib.tables._c_i_d_g.
table__c_i_d_g
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
toXML
(writer, font)¶
-
_c_m_a_p¶
-
class
fontTools.ttLib.tables._c_m_a_p.
CmapSubtable
(format)[source]¶ -
-
getEncoding
(default=None)[source]¶ Returns the Python encoding name for this cmap subtable based on its platformID, platEncID, and language. If encoding for these values is not known, by default None is returned. That can be overriden by passing a value to the default argument.
Note that if you want to choose a “preferred” cmap subtable, most of the time self.isUnicode() is what you want as that one only returns true for the modern, commonly used, Unicode-compatible triplets, not the legacy ones.
-
-
class
fontTools.ttLib.tables._c_m_a_p.
cmap_format_0
(format)[source]¶ -
-
decompileHeader
(data, ttFont)¶
-
getEncoding
(default=None)¶ Returns the Python encoding name for this cmap subtable based on its platformID, platEncID, and language. If encoding for these values is not known, by default None is returned. That can be overriden by passing a value to the default argument.
Note that if you want to choose a “preferred” cmap subtable, most of the time self.isUnicode() is what you want as that one only returns true for the modern, commonly used, Unicode-compatible triplets, not the legacy ones.
-
static
getSubtableClass
(format)¶ Return the subtable class for a format.
-
isSymbol
()¶
-
isUnicode
()¶
-
static
newSubtable
(format)¶ Return a new instance of a subtable for format.
-
toXML
(writer, ttFont)¶
-
-
class
fontTools.ttLib.tables._c_m_a_p.
cmap_format_12
(format=12)[source]¶ -
compile
(ttFont)¶
-
decompile
(data, ttFont)¶
-
decompileHeader
(data, ttFont)¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getEncoding
(default=None)¶ Returns the Python encoding name for this cmap subtable based on its platformID, platEncID, and language. If encoding for these values is not known, by default None is returned. That can be overriden by passing a value to the default argument.
Note that if you want to choose a “preferred” cmap subtable, most of the time self.isUnicode() is what you want as that one only returns true for the modern, commonly used, Unicode-compatible triplets, not the legacy ones.
-
static
getSubtableClass
(format)¶ Return the subtable class for a format.
-
isSymbol
()¶
-
isUnicode
()¶
-
static
newSubtable
(format)¶ Return a new instance of a subtable for format.
-
toXML
(writer, ttFont)¶
-
-
class
fontTools.ttLib.tables._c_m_a_p.
cmap_format_12_or_13
(format)[source]¶ -
-
getEncoding
(default=None)¶ Returns the Python encoding name for this cmap subtable based on its platformID, platEncID, and language. If encoding for these values is not known, by default None is returned. That can be overriden by passing a value to the default argument.
Note that if you want to choose a “preferred” cmap subtable, most of the time self.isUnicode() is what you want as that one only returns true for the modern, commonly used, Unicode-compatible triplets, not the legacy ones.
-
static
getSubtableClass
(format)¶ Return the subtable class for a format.
-
isSymbol
()¶
-
isUnicode
()¶
-
static
newSubtable
(format)¶ Return a new instance of a subtable for format.
-
-
class
fontTools.ttLib.tables._c_m_a_p.
cmap_format_13
(format=13)[source]¶ -
compile
(ttFont)¶
-
decompile
(data, ttFont)¶
-
decompileHeader
(data, ttFont)¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getEncoding
(default=None)¶ Returns the Python encoding name for this cmap subtable based on its platformID, platEncID, and language. If encoding for these values is not known, by default None is returned. That can be overriden by passing a value to the default argument.
Note that if you want to choose a “preferred” cmap subtable, most of the time self.isUnicode() is what you want as that one only returns true for the modern, commonly used, Unicode-compatible triplets, not the legacy ones.
-
static
getSubtableClass
(format)¶ Return the subtable class for a format.
-
isSymbol
()¶
-
isUnicode
()¶
-
static
newSubtable
(format)¶ Return a new instance of a subtable for format.
-
toXML
(writer, ttFont)¶
-
-
class
fontTools.ttLib.tables._c_m_a_p.
cmap_format_14
(format)[source]¶ -
-
getEncoding
(default=None)¶ Returns the Python encoding name for this cmap subtable based on its platformID, platEncID, and language. If encoding for these values is not known, by default None is returned. That can be overriden by passing a value to the default argument.
Note that if you want to choose a “preferred” cmap subtable, most of the time self.isUnicode() is what you want as that one only returns true for the modern, commonly used, Unicode-compatible triplets, not the legacy ones.
-
static
getSubtableClass
(format)¶ Return the subtable class for a format.
-
isSymbol
()¶
-
isUnicode
()¶
-
static
newSubtable
(format)¶ Return a new instance of a subtable for format.
-
-
class
fontTools.ttLib.tables._c_m_a_p.
cmap_format_2
(format)[source]¶ -
-
decompileHeader
(data, ttFont)¶
-
getEncoding
(default=None)¶ Returns the Python encoding name for this cmap subtable based on its platformID, platEncID, and language. If encoding for these values is not known, by default None is returned. That can be overriden by passing a value to the default argument.
Note that if you want to choose a “preferred” cmap subtable, most of the time self.isUnicode() is what you want as that one only returns true for the modern, commonly used, Unicode-compatible triplets, not the legacy ones.
-
static
getSubtableClass
(format)¶ Return the subtable class for a format.
-
isSymbol
()¶
-
isUnicode
()¶
-
static
newSubtable
(format)¶ Return a new instance of a subtable for format.
-
toXML
(writer, ttFont)¶
-
-
class
fontTools.ttLib.tables._c_m_a_p.
cmap_format_4
(format)[source]¶ -
-
decompileHeader
(data, ttFont)¶
-
getEncoding
(default=None)¶ Returns the Python encoding name for this cmap subtable based on its platformID, platEncID, and language. If encoding for these values is not known, by default None is returned. That can be overriden by passing a value to the default argument.
Note that if you want to choose a “preferred” cmap subtable, most of the time self.isUnicode() is what you want as that one only returns true for the modern, commonly used, Unicode-compatible triplets, not the legacy ones.
-
static
getSubtableClass
(format)¶ Return the subtable class for a format.
-
isSymbol
()¶
-
isUnicode
()¶
-
static
newSubtable
(format)¶ Return a new instance of a subtable for format.
-
toXML
(writer, ttFont)¶
-
-
class
fontTools.ttLib.tables._c_m_a_p.
cmap_format_6
(format)[source]¶ -
-
decompileHeader
(data, ttFont)¶
-
getEncoding
(default=None)¶ Returns the Python encoding name for this cmap subtable based on its platformID, platEncID, and language. If encoding for these values is not known, by default None is returned. That can be overriden by passing a value to the default argument.
Note that if you want to choose a “preferred” cmap subtable, most of the time self.isUnicode() is what you want as that one only returns true for the modern, commonly used, Unicode-compatible triplets, not the legacy ones.
-
static
getSubtableClass
(format)¶ Return the subtable class for a format.
-
isSymbol
()¶
-
isUnicode
()¶
-
static
newSubtable
(format)¶ Return a new instance of a subtable for format.
-
toXML
(writer, ttFont)¶
-
-
class
fontTools.ttLib.tables._c_m_a_p.
cmap_format_unknown
(format)[source]¶ -
-
getEncoding
(default=None)¶ Returns the Python encoding name for this cmap subtable based on its platformID, platEncID, and language. If encoding for these values is not known, by default None is returned. That can be overriden by passing a value to the default argument.
Note that if you want to choose a “preferred” cmap subtable, most of the time self.isUnicode() is what you want as that one only returns true for the modern, commonly used, Unicode-compatible triplets, not the legacy ones.
-
static
getSubtableClass
(format)¶ Return the subtable class for a format.
-
isSymbol
()¶
-
isUnicode
()¶
-
static
newSubtable
(format)¶ Return a new instance of a subtable for format.
-
-
class
fontTools.ttLib.tables._c_m_a_p.
table__c_m_a_p
(tag=None)[source]¶ -
buildReversed
()[source]¶ Returns a reverse cmap such as {‘one’:{0x31}, ‘A’:{0x41,0x391}}.
The values are sets of Unicode codepoints because some fonts map different codepoints to the same glyph. For example, U+0041 LATIN CAPITAL LETTER A and U+0391 GREEK CAPITAL LETTER ALPHA are sometimes the same glyph.
-
closure_glyphs
(s)¶
-
dependencies
= []¶
-
getBestCmap
(cmapPreferences=((3, 10), (0, 6), (0, 4), (3, 1), (0, 3), (0, 2), (0, 1), (0, 0)))[source]¶ Return the ‘best’ unicode cmap dictionary available in the font, or None, if no unicode cmap subtable is available.
By default it will search for the following (platformID, platEncID) pairs:
(3, 10), (0, 6), (0, 4), (3, 1), (0, 3), (0, 2), (0, 1), (0, 0)
This can be customized via the cmapPreferences argument.
-
merge
(m, tables)¶
-
prune_pre_subset
(font, options)¶
-
subset_glyphs
(s)¶
-
_c_v_a_r¶
_c_v_t¶
_f_e_a_t¶
-
class
fontTools.ttLib.tables._f_e_a_t.
table__f_e_a_t
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
toXML
(writer, font)¶
-
_f_p_g_m¶
_f_v_a_r¶
_g_a_s_p¶
_g_c_i_d¶
-
class
fontTools.ttLib.tables._g_c_i_d.
table__g_c_i_d
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
toXML
(writer, font)¶
-
_g_l_y_f¶
_g_l_y_f.py – Converter classes for the ‘glyf’ table.
-
class
fontTools.ttLib.tables._g_l_y_f.
CompositeMaxpValues
(nPoints, nContours, maxComponentDepth)¶ -
count
(value, /)¶ Return number of occurrences of value.
-
index
(value, start=0, stop=9223372036854775807, /)¶ Return first index of value.
Raises ValueError if the value is not present.
-
maxComponentDepth
¶ Alias for field number 2
-
nContours
¶ Alias for field number 1
-
nPoints
¶ Alias for field number 0
-
-
class
fontTools.ttLib.tables._g_l_y_f.
Glyph
(data='')[source]¶ -
-
drawPoints
(pen, glyfTable, offset=0)[source]¶ Draw the glyph using the supplied pointPen. Opposed to Glyph.draw(), this will not change the point indices.
-
remapComponentsFast
(glyphidmap)¶
-
-
class
fontTools.ttLib.tables._g_l_y_f.
GlyphCoordinates
(iterable=[], typecode='h')[source]¶ -
-
property
array
¶
-
property
-
fontTools.ttLib.tables._g_l_y_f.
flagBest
(x, y, onCurve)[source]¶ For a given x,y delta pair, returns the flag that packs this pair most efficiently, as well as the number of byte cost of such flag.
-
class
fontTools.ttLib.tables._g_l_y_f.
table__g_l_y_f
(tag=None)[source]¶ -
closure_glyphs
(s)¶
-
dependencies
= []¶
-
getCoordinatesAndControls
(glyphName, ttFont, defaultVerticalOrigin=None)[source]¶ Return glyph coordinates and controls as expected by “gvar” table.
The coordinates includes four “phantom points” for the glyph metrics, as mandated by the “gvar” spec.
- The glyph controls is a namedtuple with the following attributes:
numberOfContours: -1 for composite glyphs.
endPts: list of indices of end points for each contour in simple
glyphs, or component indices in composite glyphs (used for IUP optimization). - flags: array of contour point flags for simple glyphs (None for composite glyphs). - components: list of base glyph names (str) for each component in composite glyphs (None for simple glyphs).
The “ttFont” and “defaultVerticalOrigin” args are used to compute the “phantom points” (see “getPhantomPoints” method).
Return None if the requested glyphName is not present.
-
getPhantomPoints
(glyphName, ttFont, defaultVerticalOrigin=None)[source]¶ Compute the four “phantom points” for the given glyph from its bounding box and the horizontal and vertical advance widths and sidebearings stored in the ttFont’s “hmtx” and “vmtx” tables.
If the ttFont doesn’t contain a “vmtx” table, the hhea.ascent is used as the vertical origin, and the head.unitsPerEm as the vertical advance.
The “defaultVerticalOrigin” (Optional[int]) is needed when the ttFont contains neither a “vmtx” nor an “hhea” table, as may happen with ‘sparse’ masters. The value should be the hhea.ascent of the default master.
https://docs.microsoft.com/en-us/typography/opentype/spec/tt_instructing_glyphs#phantoms
-
merge
(m, tables)¶
-
mergeMap
= {'glyphOrder': <function sumLists>, 'glyphs': <function sumDicts>, 'tableTag': <function equal>}¶
-
padding
= 1¶
-
prune_post_subset
(font, options)¶
-
prune_pre_subset
(font, options)¶
-
setCoordinates
(glyphName, coord, ttFont)[source]¶ Set coordinates and metrics for the given glyph.
“coord” is an array of GlyphCoordinates which must include the “phantom points” as the last four coordinates.
Both the horizontal/vertical advances and left/top sidebearings in “hmtx” and “vmtx” tables (if any) are updated from four phantom points and the glyph’s bounding boxes.
-
subset_glyphs
(s)¶
-
_g_v_a_r¶
-
fontTools.ttLib.tables._g_v_a_r.
compileGlyph_
(variations, pointCount, axisTags, sharedCoordIndices)[source]¶
-
class
fontTools.ttLib.tables._g_v_a_r.
table__g_v_a_r
(tag=None)[source]¶ -
-
static
compileOffsets_
(offsets)[source]¶ Packs a list of offsets into a ‘gvar’ offset table.
Returns a pair (bytestring, tableFormat). Bytestring is the packed offset table. Format indicates whether the table uses short (tableFormat=0) or long (tableFormat=1) integers. The returned tableFormat should get packed into the flags field of the ‘gvar’ header.
-
dependencies
= ['fvar', 'glyf']¶
-
merge
(m, tables)¶
-
prune_pre_subset
(font, options)¶
-
subset_glyphs
(s)¶
-
static
_h_d_m_x¶
_h_e_a_d¶
-
class
fontTools.ttLib.tables._h_e_a_d.
table__h_e_a_d
(tag=None)[source]¶ -
-
dependencies
= ['maxp', 'loca', 'CFF ', 'CFF2']¶
-
merge
(m, tables)¶
-
mergeMap
= {'checkSumAdjustment': <function <lambda>>, 'created': <function current_time>, 'flags': <function mergeBits.<locals>.wrapper>, 'fontDirectionHint': <function <lambda>>, 'fontRevision': <built-in function max>, 'glyphDataFormat': <function equal>, 'indexToLocFormat': <function recalculate>, 'lowestRecPPEM': <built-in function max>, 'macStyle': <function first>, 'magicNumber': <function equal>, 'modified': <function current_time>, 'tableTag': <function equal>, 'tableVersion': <built-in function max>, 'unitsPerEm': <function equal>, 'xMax': <built-in function max>, 'xMin': <built-in function min>, 'yMax': <built-in function max>, 'yMin': <built-in function min>}¶
-
prune_post_subset
(font, options)¶
-
_h_h_e_a¶
-
class
fontTools.ttLib.tables._h_h_e_a.
table__h_h_e_a
(tag=None)[source]¶ -
property
ascender
¶
-
dependencies
= ['hmtx', 'glyf', 'CFF ', 'CFF2']¶
-
property
descender
¶
-
merge
(m, tables)¶
-
mergeMap
= {'*': <function equal>, 'advanceWidthMax': <built-in function max>, 'ascent': <built-in function max>, 'caretOffset': <function first>, 'caretSlopeRise': <function first>, 'caretSlopeRun': <function first>, 'descent': <built-in function min>, 'lineGap': <built-in function max>, 'minLeftSideBearing': <built-in function min>, 'minRightSideBearing': <built-in function min>, 'numberOfHMetrics': <function recalculate>, 'tableTag': <function equal>, 'tableVersion': <built-in function max>, 'xMaxExtent': <built-in function max>}¶
-
property
_h_m_t_x¶
-
class
fontTools.ttLib.tables._h_m_t_x.
table__h_m_t_x
(tag=None)[source]¶ -
advanceName
= 'width'¶
-
dependencies
= []¶
-
headerTag
= 'hhea'¶
-
longMetricFormat
= 'Hh'¶
-
merge
(m, tables)¶
-
mergeMap
= {'metrics': <function sumDicts>, 'tableTag': <function equal>}¶
-
numberOfMetricsName
= 'numberOfHMetrics'¶
-
sideBearingName
= 'lsb'¶
-
subset_glyphs
(s)¶
-
_k_e_r_n¶
-
class
fontTools.ttLib.tables._k_e_r_n.
KernTable_format_0
(apple=False)[source]¶ -
-
format
= 0¶
-
version
= 0¶
-
_l_c_a_r¶
-
class
fontTools.ttLib.tables._l_c_a_r.
table__l_c_a_r
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
subset_glyphs
(s)¶
-
toXML
(writer, font)¶
-
_l_o_c_a¶
_l_t_a_g¶
_m_a_x_p¶
-
class
fontTools.ttLib.tables._m_a_x_p.
table__m_a_x_p
(tag=None)[source]¶ -
-
dependencies
= ['glyf']¶
-
merge
(m, tables)¶
-
mergeMap
= {'*': <built-in function max>, 'maxFunctionDefs': <function first>, 'maxInstructionDefs': <function first>, 'maxStorage': <function first>, 'numGlyphs': <built-in function sum>, 'tableTag': <function equal>, 'tableVersion': <function equal>}¶
-
prune_pre_subset
(font, options)¶
-
_m_e_t_a¶
_m_o_r_t¶
-
class
fontTools.ttLib.tables._m_o_r_t.
table__m_o_r_t
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
toXML
(writer, font)¶
-
_m_o_r_x¶
-
class
fontTools.ttLib.tables._m_o_r_x.
table__m_o_r_x
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
toXML
(writer, font)¶
-
_n_a_m_e¶
-
class
fontTools.ttLib.tables._n_a_m_e.
NameRecord
[source]¶ -
-
getEncoding
(default='ascii')[source]¶ Returns the Python encoding name for this name entry based on its platformID, platEncID, and langID. If encoding for these values is not known, by default ‘ascii’ is returned. That can be overriden by passing a value to the default argument.
-
toBytes
(errors='strict')[source]¶ If self.string is a bytes object, return it; otherwise try encoding the Unicode string in self.string to bytes using the encoding of this entry as returned by self.getEncoding(); Note that self.getEncoding() returns ‘ascii’ if the encoding is unknown to the library.
If the Unicode string cannot be encoded to bytes in the chosen encoding, the error is handled according to the errors parameter to this function, which is passed to the underlying encode() function; by default it throws a UnicodeEncodeError exception.
-
toStr
(errors='strict')¶ If self.string is a Unicode string, return it; otherwise try decoding the bytes in self.string to a Unicode string using the encoding of this entry as returned by self.getEncoding(); Note that self.getEncoding() returns ‘ascii’ if the encoding is unknown to the library.
Certain heuristics are performed to recover data from bytes that are ill-formed in the chosen encoding, or that otherwise look misencoded (mostly around bad UTF-16BE encoded bytes, or bytes that look like UTF-16BE but marked otherwise). If the bytes are ill-formed and the heuristics fail, the error is handled according to the errors parameter to this function, which is passed to the underlying decode() function; by default it throws a UnicodeDecodeError exception.
Note: The mentioned heuristics mean that roundtripping a font to XML and back to binary might recover some misencoded data whereas just loading the font and saving it back will not change them.
-
toUnicode
(errors='strict')[source]¶ If self.string is a Unicode string, return it; otherwise try decoding the bytes in self.string to a Unicode string using the encoding of this entry as returned by self.getEncoding(); Note that self.getEncoding() returns ‘ascii’ if the encoding is unknown to the library.
Certain heuristics are performed to recover data from bytes that are ill-formed in the chosen encoding, or that otherwise look misencoded (mostly around bad UTF-16BE encoded bytes, or bytes that look like UTF-16BE but marked otherwise). If the bytes are ill-formed and the heuristics fail, the error is handled according to the errors parameter to this function, which is passed to the underlying decode() function; by default it throws a UnicodeDecodeError exception.
Note: The mentioned heuristics mean that roundtripping a font to XML and back to binary might recover some misencoded data whereas just loading the font and saving it back will not change them.
-
-
class
fontTools.ttLib.tables._n_a_m_e.
table__n_a_m_e
(tag=None)[source]¶ -
addMultilingualName
(names, ttFont=None, nameID=None, windows=True, mac=True, minNameID=0)[source]¶ Add a multilingual name, returning its name ID
‘names’ is a dictionary with the name in multiple languages, such as {‘en’: ‘Pale’, ‘de’: ‘Blaß’, ‘de-CH’: ‘Blass’}. The keys can be arbitrary IETF BCP 47 language codes; the values are Unicode strings.
‘ttFont’ is the TTFont to which the names are added, or None. If present, the font’s ‘ltag’ table can get populated to store exotic language codes, which allows encoding names that otherwise cannot get encoded at all.
‘nameID’ is the name ID to be used, or None to let the library find an existing set of name records that match, or pick an unused name ID.
If ‘windows’ is True, a platformID=3 name record will be added. If ‘mac’ is True, a platformID=1 name record will be added.
If the ‘nameID’ argument is None, the created nameID will not be less than the ‘minNameID’ argument.
-
addName
(string, platforms=((1, 0, 0), (3, 1, 1033)), minNameID=255)[source]¶ Add a new name record containing ‘string’ for each (platformID, platEncID, langID) tuple specified in the ‘platforms’ list.
The nameID is assigned in the range between ‘minNameID’+1 and 32767 (inclusive), following the last nameID in the name table. If no ‘platforms’ are specified, two English name records are added, one for the Macintosh (platformID=0), and one for the Windows platform (3).
The ‘string’ must be a Unicode string, so it can be encoded with different, platform-specific encodings.
Return the new nameID.
-
dependencies
= ['ltag']¶
-
findMultilingualName
(names, windows=True, mac=True, minNameID=0)[source]¶ Return the name ID of an existing multilingual name that matches the ‘names’ dictionary, or None if not found.
‘names’ is a dictionary with the name in multiple languages, such as {‘en’: ‘Pale’, ‘de’: ‘Blaß’, ‘de-CH’: ‘Blass’}. The keys can be arbitrary IETF BCP 47 language codes; the values are Unicode strings.
If ‘windows’ is True, the returned name ID is guaranteed exist for all requested languages for platformID=3 and platEncID=1. If ‘mac’ is True, the returned name ID is guaranteed to exist for all requested languages for platformID=1 and platEncID=0.
The returned name ID will not be less than the ‘minNameID’ argument.
-
merge
(m, tables)¶
-
mergeMap
= {'names': <function first>, 'tableTag': <function equal>}¶
-
prune_pre_subset
(font, options)¶
-
removeNames
(nameID=None, platformID=None, platEncID=None, langID=None)[source]¶ Remove any name records identified by the given combination of ‘nameID’, ‘platformID’, ‘platEncID’ and ‘langID’.
-
setName
(string, nameID, platformID, platEncID, langID)[source]¶ Set the ‘string’ for the name record identified by ‘nameID’, ‘platformID’, ‘platEncID’ and ‘langID’. If a record with that nameID doesn’t exist, create it and append to the name table.
‘string’ can be of type str (unicode in PY2) or bytes. In the latter case, it is assumed to be already encoded with the correct plaform-specific encoding identified by the (platformID, platEncID, langID) triplet. A warning is issued to prevent unexpected results.
-
_o_p_b_d¶
-
class
fontTools.ttLib.tables._o_p_b_d.
table__o_p_b_d
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
subset_glyphs
(s)¶
-
toXML
(writer, font)¶
-
_p_o_s_t¶
-
class
fontTools.ttLib.tables._p_o_s_t.
table__p_o_s_t
(tag=None)[source]¶ -
-
dependencies
= []¶
-
getGlyphOrder
()[source]¶ This function will get called by a ttLib.TTFont instance. Do not call this function yourself, use TTFont().getGlyphOrder() or its relatives instead!
-
merge
(m, tables)¶
-
mergeMap
= {'*': <function first>, 'extraNames': <function <lambda>>, 'formatType': <built-in function max>, 'isFixedPitch': <built-in function min>, 'mapping': <function onlyExisting.<locals>.wrapper>, 'maxMemType1': <function <lambda>>, 'maxMemType42': <function <lambda>>, 'minMemType1': <built-in function max>, 'minMemType42': <built-in function max>, 'tableTag': <function equal>}¶
-
prune_pre_subset
(font, options)¶
-
subset_glyphs
(s)¶
-
_p_r_e_p¶
_p_r_o_p¶
-
class
fontTools.ttLib.tables._p_r_o_p.
table__p_r_o_p
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
subset_glyphs
(s)¶
-
toXML
(writer, font)¶
-
_s_b_i_x¶
_t_r_a_k¶
-
class
fontTools.ttLib.tables._t_r_a_k.
TrackData
(initialdata={})[source]¶ -
clear
() → None. Remove all items from D.¶
-
get
(k[, d]) → D[k] if k in D, else d. d defaults to None.¶
-
items
() → a set-like object providing a view on D’s items¶
-
pop
(k[, d]) → v, remove specified key and return the corresponding value.¶ If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), remove and return some (key, value) pair¶ as a 2-tuple; but raise KeyError if D is empty.
-
setdefault
(k[, d]) → D.get(k,d), also set D[k]=d if k not in D¶
-
tracks
()¶ D.keys() -> a set-like object providing a view on D’s keys
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F.¶ If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → an object providing a view on D’s values¶
-
-
class
fontTools.ttLib.tables._t_r_a_k.
TrackTableEntry
(values={}, nameIndex=None)[source]¶ -
clear
() → None. Remove all items from D.¶
-
get
(k[, d]) → D[k] if k in D, else d. d defaults to None.¶
-
items
() → a set-like object providing a view on D’s items¶
-
pop
(k[, d]) → v, remove specified key and return the corresponding value.¶ If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), remove and return some (key, value) pair¶ as a 2-tuple; but raise KeyError if D is empty.
-
setdefault
(k[, d]) → D.get(k,d), also set D[k]=d if k not in D¶
-
sizes
()¶ D.keys() -> a set-like object providing a view on D’s keys
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F.¶ If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → an object providing a view on D’s values¶
-
_v_h_e_a¶
-
class
fontTools.ttLib.tables._v_h_e_a.
table__v_h_e_a
(tag=None)[source]¶ -
-
dependencies
= ['vmtx', 'glyf', 'CFF ', 'CFF2']¶
-
merge
(m, tables)¶
-
mergeMap
= {'*': <function equal>, 'advanceHeightMax': <built-in function max>, 'ascent': <built-in function max>, 'caretOffset': <function first>, 'caretSlopeRise': <function first>, 'caretSlopeRun': <function first>, 'descent': <built-in function min>, 'lineGap': <built-in function max>, 'minBottomSideBearing': <built-in function min>, 'minTopSideBearing': <built-in function min>, 'numberOfVMetrics': <function recalculate>, 'tableTag': <function equal>, 'tableVersion': <built-in function max>, 'yMaxExtent': <built-in function max>}¶
-
property
reserved0
¶
-
_v_m_t_x¶
-
class
fontTools.ttLib.tables._v_m_t_x.
table__v_m_t_x
(tag=None)[source]¶ -
advanceName
= 'height'¶
-
compile
(ttFont)¶
-
decompile
(data, ttFont)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, ttFont)¶
-
headerTag
= 'vhea'¶
-
longMetricFormat
= 'Hh'¶
-
merge
(m, tables)¶
-
mergeMap
= {'metrics': <function sumDicts>, 'tableTag': <function equal>}¶
-
numberOfMetricsName
= 'numberOfVMetrics'¶
-
sideBearingName
= 'tsb'¶
-
subset_glyphs
(s)¶
-
toXML
(writer, ttFont)¶
-
asciiTable¶
B_A_S_E¶
-
class
fontTools.ttLib.tables.B_A_S_E_.
table_B_A_S_E_
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
mergeMap
= {'table': <function mergeObjects>, 'tableTag': <function onlyExisting.<locals>.wrapper>}¶
-
toXML
(writer, font)¶
-
BitmapGlyphMetrics¶
-
class
fontTools.ttLib.tables.BitmapGlyphMetrics.
BigGlyphMetrics
[source]¶ -
binaryFormat
= '\n > # big endian\n height: B\n width: B\n horiBearingX: b\n horiBearingY: b\n horiAdvance: B\n vertBearingX: b\n vertBearingY: b\n vertAdvance: B\n'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
toXML
(writer, ttFont)¶
-
C_B_D_T¶
-
class
fontTools.ttLib.tables.C_B_D_T_.
ColorBitmapGlyph
(data, ttFont)[source]¶ -
fileExtension
= '.png'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getFormat
()¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
toXML
(strikeIndex, glyphName, writer, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>)}¶
-
-
class
fontTools.ttLib.tables.C_B_D_T_.
cbdt_bitmap_format_17
(data, ttFont)[source]¶ -
-
fileExtension
= '.png'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getFormat
()¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
toXML
(strikeIndex, glyphName, writer, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>)}¶
-
-
class
fontTools.ttLib.tables.C_B_D_T_.
cbdt_bitmap_format_18
(data, ttFont)[source]¶ -
-
fileExtension
= '.png'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getFormat
()¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
toXML
(strikeIndex, glyphName, writer, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>)}¶
-
-
class
fontTools.ttLib.tables.C_B_D_T_.
cbdt_bitmap_format_19
(data, ttFont)[source]¶ -
-
fileExtension
= '.png'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getFormat
()¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
toXML
(strikeIndex, glyphName, writer, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>)}¶
-
C_F_F¶
C_F_F__2¶
-
class
fontTools.ttLib.tables.C_F_F__2.
table_C_F_F__2
(tag=None)[source]¶ -
closure_glyphs
(s)¶
-
dependencies
= []¶
-
desubroutinize
()¶
-
fromXML
(name, attrs, content, otFont)¶
-
getGlyphOrder
()¶
-
haveGlyphNames
()¶
-
merge
(m, tables)¶
-
prune_post_subset
(ttfFont, options)¶
-
prune_pre_subset
(font, options)¶
-
remove_hints
()¶
-
remove_unused_subroutines
()¶
-
setGlyphOrder
(glyphOrder)¶
-
subset_glyphs
(s)¶
-
toXML
(writer, otFont)¶
-
C_O_L_R¶
-
class
fontTools.ttLib.tables.C_O_L_R_.
table_C_O_L_R_
(tag=None)[source]¶ This table is structured so that you can treat it like a dictionary keyed by glyph name. ttFont[‘COLR’][<glyphName>] will return the color layers for any glyph ttFont[‘COLR’][<glyphName>] = <value> will set the color layers for any glyph.
-
closure_glyphs
(s)¶
-
dependencies
= []¶
-
merge
(m, tables)¶
-
subset_glyphs
(s)¶
-
C_P_A_L¶
-
class
fontTools.ttLib.tables.C_P_A_L_.
Color
(blue, green, red, alpha)[source]¶ -
alpha
¶ Alias for field number 3
-
blue
¶ Alias for field number 0
-
count
(value, /)¶ Return number of occurrences of value.
-
green
¶ Alias for field number 1
-
index
(value, start=0, stop=9223372036854775807, /)¶ Return first index of value.
Raises ValueError if the value is not present.
-
red
¶ Alias for field number 2
-
D_S_I_G¶
-
fontTools.ttLib.tables.D_S_I_G_.
pem_spam
(l, spam={'': True, '-----BEGIN PKCS7-----': True, '-----END PKCS7-----': True})¶
DefaultTable¶
E_B_D_T¶
-
class
fontTools.ttLib.tables.E_B_D_T_.
BitmapGlyph
(data, ttFont)[source]¶ -
fileExtension
= '.bin'¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>), 'row': (<function _writeRowImageData>, <function _readRowImageData>)}¶
-
-
fontTools.ttLib.tables.E_B_D_T_.
BitmapPlusBigMetricsMixin
¶ alias of
fontTools.ttLib.tables.E_B_D_T_._createBitmapPlusMetricsMixin.<locals>.BitmapPlusMetricsMixin
-
fontTools.ttLib.tables.E_B_D_T_.
BitmapPlusSmallMetricsMixin
¶ alias of
fontTools.ttLib.tables.E_B_D_T_._createBitmapPlusMetricsMixin.<locals>.BitmapPlusMetricsMixin
-
class
fontTools.ttLib.tables.E_B_D_T_.
ComponentBitmapGlyph
(data, ttFont)[source]¶ -
fileExtension
= '.bin'¶
-
getFormat
()¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>), 'row': (<function _writeRowImageData>, <function _readRowImageData>)}¶
-
-
class
fontTools.ttLib.tables.E_B_D_T_.
ebdt_bitmap_format_1
(data, ttFont)[source]¶ -
-
fileExtension
= '.bin'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getFormat
()¶
-
getRow
(row, bitDepth=1, metrics=None, reverseBytes=False)¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
setRows
(dataRows, bitDepth=1, metrics=None, reverseBytes=False)¶
-
toXML
(strikeIndex, glyphName, writer, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>), 'row': (<function _writeRowImageData>, <function _readRowImageData>)}¶
-
-
class
fontTools.ttLib.tables.E_B_D_T_.
ebdt_bitmap_format_2
(data, ttFont)[source]¶ -
-
fileExtension
= '.bin'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getFormat
()¶
-
getRow
(row, bitDepth=1, metrics=None, reverseBytes=False)¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
setRows
(dataRows, bitDepth=1, metrics=None, reverseBytes=False)¶
-
toXML
(strikeIndex, glyphName, writer, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>), 'row': (<function _writeRowImageData>, <function _readRowImageData>)}¶
-
-
class
fontTools.ttLib.tables.E_B_D_T_.
ebdt_bitmap_format_5
(data, ttFont)[source]¶ -
-
fileExtension
= '.bin'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getFormat
()¶
-
getRow
(row, bitDepth=1, metrics=None, reverseBytes=False)¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
setRows
(dataRows, bitDepth=1, metrics=None, reverseBytes=False)¶
-
toXML
(strikeIndex, glyphName, writer, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>), 'row': (<function _writeRowImageData>, <function _readRowImageData>)}¶
-
-
class
fontTools.ttLib.tables.E_B_D_T_.
ebdt_bitmap_format_6
(data, ttFont)[source]¶ -
-
fileExtension
= '.bin'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getFormat
()¶
-
getRow
(row, bitDepth=1, metrics=None, reverseBytes=False)¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
setRows
(dataRows, bitDepth=1, metrics=None, reverseBytes=False)¶
-
toXML
(strikeIndex, glyphName, writer, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>), 'row': (<function _writeRowImageData>, <function _readRowImageData>)}¶
-
-
class
fontTools.ttLib.tables.E_B_D_T_.
ebdt_bitmap_format_7
(data, ttFont)[source]¶ -
-
fileExtension
= '.bin'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getFormat
()¶
-
getRow
(row, bitDepth=1, metrics=None, reverseBytes=False)¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
setRows
(dataRows, bitDepth=1, metrics=None, reverseBytes=False)¶
-
toXML
(strikeIndex, glyphName, writer, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>), 'row': (<function _writeRowImageData>, <function _readRowImageData>)}¶
-
-
class
fontTools.ttLib.tables.E_B_D_T_.
ebdt_bitmap_format_8
(data, ttFont)[source]¶ -
-
fileExtension
= '.bin'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getFormat
()¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
toXML
(strikeIndex, glyphName, writer, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>), 'row': (<function _writeRowImageData>, <function _readRowImageData>)}¶
-
-
class
fontTools.ttLib.tables.E_B_D_T_.
ebdt_bitmap_format_9
(data, ttFont)[source]¶ -
-
fileExtension
= '.bin'¶
-
fromXML
(name, attrs, content, ttFont)¶
-
getFormat
()¶
-
readData
(name, attrs, content, ttFont)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
toXML
(strikeIndex, glyphName, writer, ttFont)¶
-
writeData
(strikeIndex, glyphName, writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
xmlDataFunctions
= {'bitwise': (<function _writeBitwiseImageData>, <function _readBitwiseImageData>), 'extfile': (<function _writeExtFileImageData>, <function _readExtFileImageData>), 'raw': (<function _writeRawImageData>, <function _readRawImageData>), 'row': (<function _writeRowImageData>, <function _readRowImageData>)}¶
-
E_B_L_C¶
-
class
fontTools.ttLib.tables.E_B_L_C_.
eblc_index_sub_table_1
(data, ttFont)[source]¶ -
compile
(ttFont)¶
-
decompile
()¶
-
fromXML
(name, attrs, content, ttFont)¶
-
padBitmapData
(data)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
removeSkipGlyphs
()¶
-
toXML
(writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
-
class
fontTools.ttLib.tables.E_B_L_C_.
eblc_index_sub_table_2
(data, ttFont)[source]¶ -
-
fromXML
(name, attrs, content, ttFont)¶
-
padBitmapData
(data)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
removeSkipGlyphs
()¶
-
toXML
(writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
-
class
fontTools.ttLib.tables.E_B_L_C_.
eblc_index_sub_table_3
(data, ttFont)[source]¶ -
compile
(ttFont)¶
-
decompile
()¶
-
fromXML
(name, attrs, content, ttFont)¶
-
padBitmapData
(data)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
removeSkipGlyphs
()¶
-
toXML
(writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
-
class
fontTools.ttLib.tables.E_B_L_C_.
eblc_index_sub_table_4
(data, ttFont)[source]¶ -
-
fromXML
(name, attrs, content, ttFont)¶
-
padBitmapData
(data)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
removeSkipGlyphs
()¶
-
toXML
(writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
-
class
fontTools.ttLib.tables.E_B_L_C_.
eblc_index_sub_table_5
(data, ttFont)[source]¶ -
-
fromXML
(name, attrs, content, ttFont)¶
-
padBitmapData
(data)¶
-
readMetrics
(name, attrs, content, ttFont)¶
-
removeSkipGlyphs
()¶
-
toXML
(writer, ttFont)¶
-
writeMetrics
(writer, ttFont)¶
-
F__e_a_t¶
G__l_a_t¶
G__l_o_c¶
G_D_E_F¶
-
class
fontTools.ttLib.tables.G_D_E_F_.
table_G_D_E_F_
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
mergeMap
= {'table': <function mergeObjects>, 'tableTag': <function onlyExisting.<locals>.wrapper>}¶
-
prune_post_subset
(font, options)¶
-
subset_glyphs
(s)¶
-
toXML
(writer, font)¶
-
G_M_A_P¶
G_P_O_S¶
-
class
fontTools.ttLib.tables.G_P_O_S_.
table_G_P_O_S_
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
mergeMap
= {'table': <function mergeObjects>, 'tableTag': <function onlyExisting.<locals>.wrapper>}¶
-
neuter_lookups
(lookup_indices)¶ Sets lookups not in lookup_indices to None.
-
prune_features
()¶ Remove unreferenced features
-
prune_lookups
(remap=True)¶ Remove (default) or neuter unreferenced lookups
-
prune_post_subset
(font, options)¶
-
prune_pre_subset
(font, options)¶
-
remove_redundant_langsys
()¶
-
retain_empty_scripts
()¶
-
subset_glyphs
(s)¶
-
subset_lookups
(lookup_indices)¶ Retains specified lookups, then removes empty features, language systems, and scripts.
-
toXML
(writer, font)¶
-
G_S_U_B¶
-
class
fontTools.ttLib.tables.G_S_U_B_.
table_G_S_U_B_
(tag=None)[source]¶ -
closure_glyphs
(s)¶
-
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
mergeMap
= {'table': <function mergeObjects>, 'tableTag': <function onlyExisting.<locals>.wrapper>}¶
-
neuter_lookups
(lookup_indices)¶ Sets lookups not in lookup_indices to None.
-
prune_features
()¶ Remove unreferenced features
-
prune_lookups
(remap=True)¶ Remove (default) or neuter unreferenced lookups
-
prune_post_subset
(font, options)¶
-
prune_pre_subset
(font, options)¶
-
remove_redundant_langsys
()¶
-
retain_empty_scripts
()¶
-
subset_glyphs
(s)¶
-
subset_lookups
(lookup_indices)¶ Retains specified lookups, then removes empty features, language systems, and scripts.
-
toXML
(writer, font)¶
-
grUtils¶
H_V_A_R¶
-
class
fontTools.ttLib.tables.H_V_A_R_.
table_H_V_A_R_
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
subset_glyphs
(s)¶
-
toXML
(writer, font)¶
-
J_S_T_F¶
-
class
fontTools.ttLib.tables.J_S_T_F_.
table_J_S_T_F_
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
mergeMap
= {'table': <function mergeObjects>, 'tableTag': <function onlyExisting.<locals>.wrapper>}¶
-
toXML
(writer, font)¶
-
M_A_T_H¶
-
class
fontTools.ttLib.tables.M_A_T_H_.
table_M_A_T_H_
(tag=None)[source]¶ -
closure_glyphs
(s)¶
-
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
mergeMap
= {'table': <function mergeObjects>, 'tableTag': <function onlyExisting.<locals>.wrapper>}¶
-
subset_glyphs
(s)¶
-
toXML
(writer, font)¶
-
M_E_T_A¶
M_V_A_R¶
-
class
fontTools.ttLib.tables.M_V_A_R_.
table_M_V_A_R_
(tag=None)[source]¶ -
compile
(font)¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
decompile
(data, font)¶
-
dependencies
= []¶
-
fromXML
(name, attrs, content, font)¶
-
merge
(m, tables)¶
-
toXML
(writer, font)¶
-
O_S_2f_2¶
-
fontTools.ttLib.tables.O_S_2f_2.
intersectUnicodeRanges
(unicodes, inverse=False)[source]¶ Intersect a sequence of (int) Unicode codepoints with the Unicode block ranges defined in the OpenType specification v1.7, and return the set of ‘ulUnicodeRanges’ bits for which there is at least ONE intersection. If ‘inverse’ is True, return the the bits for which there is NO intersection.
>>> intersectUnicodeRanges([0x0410]) == {9} True >>> intersectUnicodeRanges([0x0410, 0x1F000]) == {9, 57, 122} True >>> intersectUnicodeRanges([0x0410, 0x1F000], inverse=True) == ( ... set(range(len(OS2_UNICODE_RANGES))) - {9, 57, 122}) True
-
class
fontTools.ttLib.tables.O_S_2f_2.
table_O_S_2f_2
(tag=None)[source]¶ the OS/2 table
-
dependencies
= ['head']¶
-
property
fsFirstCharIndex
¶
-
property
fsLastCharIndex
¶
-
merge
(m, tables)¶
-
mergeMap
= {'*': <function first>, 'fsFirstCharIndex': <built-in function min>, 'fsLastCharIndex': <built-in function max>, 'fsType': <function mergeOs2FsType>, 'panose': <function first>, 'sCapHeight': <function onlyExisting.<locals>.wrapper>, 'sTypoAscender': <built-in function max>, 'sTypoDescender': <built-in function min>, 'sTypoLineGap': <built-in function max>, 'sxHeight': <function onlyExisting.<locals>.wrapper>, 'tableTag': <function equal>, 'ulCodePageRange1': <function onlyExisting.<locals>.wrapper>, 'ulCodePageRange2': <function onlyExisting.<locals>.wrapper>, 'ulUnicodeRange1': <function bitwise_or>, 'ulUnicodeRange2': <function bitwise_or>, 'ulUnicodeRange3': <function bitwise_or>, 'ulUnicodeRange4': <function bitwise_or>, 'usBreakChar': <function onlyExisting.<locals>.wrapper>, 'usDefaultChar': <function onlyExisting.<locals>.wrapper>, 'usLowerOpticalPointSize': <function onlyExisting.<locals>.wrapper>, 'usMaxContext': <function onlyExisting.<locals>.wrapper>, 'usUpperOpticalPointSize': <function onlyExisting.<locals>.wrapper>, 'usWinAscent': <built-in function max>, 'usWinDescent': <built-in function max>, 'version': <built-in function max>, 'xAvgCharWidth': <function avg_int>}¶
-
recalcUnicodeRanges
(ttFont, pruneOnly=False)[source]¶ Intersect the codepoints in the font’s Unicode cmap subtables with the Unicode block ranges defined in the OpenType specification (v1.7), and set the respective ‘ulUnicodeRange*’ bits if there is at least ONE intersection. If ‘pruneOnly’ is True, only clear unused bits with NO intersection.
-
property
usMaxContex
¶
-
otBase¶
-
class
fontTools.ttLib.tables.otBase.
BaseTTXConverter
(tag=None)[source]¶ Generic base class for TTX table converters. It functions as an adapter between the TTX (ttLib actually) table model and the model we use for OpenType tables, which is necessarily subtly different.
-
compile
(font)[source]¶ Create a top-level OTTableWriter for the GPOS/GSUB table. Call the compile method for the the table
- for each ‘converter’ record in the table converter list
- call converter’s write method for each item in the value.
For simple items, the write method adds a string to the
writer’s self.items list. - For Struct/Table/Subtable items, it add first adds new writer to the to the writer’s self.items, then calls the item’s compile method. This creates a tree of writers, rooted at the GUSB/GPOS writer, with each writer representing a table, and the writer.items list containing the child data strings and writers.
- call the getAllData method
call _doneWriting, which removes duplicates call _gatherTables. This traverses the tables, adding unique occurences to a flat list of tables Traverse the flat list of tables, calling getDataLength on each to update their position Traverse the flat list of tables again, calling getData each get the data in the table, now that pos’s and offset are known.
If a lookup subtable overflows an offset, we have to start all over.
-
dependencies
= []¶
-
merge
(m, tables)¶
-
-
class
fontTools.ttLib.tables.otBase.
BaseTable
[source]¶ Generic base class for all OpenType (sub)tables.
-
class
fontTools.ttLib.tables.otBase.
CountReference
(table, name, size=None, value=None)[source]¶ A reference to a Count value, not a count of references.
-
class
fontTools.ttLib.tables.otBase.
FormatSwitchingBaseTable
[source]¶ Minor specialization of BaseTable, for tables that have multiple formats, eg. CoverageFormat1 vs. CoverageFormat2.
-
compile
(writer, font)¶
-
decompile
(reader, font)¶
-
ensureDecompiled
()¶
-
fromXML
(name, attrs, content, font)¶
-
populateDefaults
(propagator=None)¶
-
toXML2
(xmlWriter, font)¶
-
-
exception
fontTools.ttLib.tables.otBase.
OTLOffsetOverflowError
(overflowErrorRecord)[source]¶ -
args
¶
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
fontTools.ttLib.tables.otBase.
OTTableReader
(data, localState=None, offset=0, tableTag=None)[source]¶ Helper class to retrieve data from an OpenType table.
-
data
¶
-
localState
¶
-
offset
¶
-
pos
¶
-
tableTag
¶
-
-
class
fontTools.ttLib.tables.otBase.
OTTableWriter
(localState=None, tableTag=None, offsetSize=2)[source]¶ Helper class to gather and assemble data for OpenType tables.
-
property
longOffset
¶
-
property
-
class
fontTools.ttLib.tables.otBase.
UInt8FormatSwitchingBaseTable
[source]¶ -
compile
(writer, font)¶
-
decompile
(reader, font)¶
-
ensureDecompiled
()¶
-
fromXML
(name, attrs, content, font)¶
-
getConverterByName
(name)¶
-
getConverters
()¶
-
classmethod
getRecordSize
(reader)¶
-
populateDefaults
(propagator=None)¶
-
toXML
(xmlWriter, font, attrs=None, name=None)¶
-
toXML2
(xmlWriter, font)¶
-
otConverters¶
-
class
fontTools.ttLib.tables.otConverters.
AATLookup
(name, repeat, aux, tableClass)[source]¶ -
BIN_SEARCH_HEADER_SIZE
= 10¶
-
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
writeArray
(writer, font, tableDict, values)¶
-
-
class
fontTools.ttLib.tables.otConverters.
AATLookupWithDataOffset
(name, repeat, aux, tableClass=None)[source]¶ -
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
writeArray
(writer, font, tableDict, values)¶
-
-
class
fontTools.ttLib.tables.otConverters.
BaseConverter
(name, repeat, aux, tableClass=None)[source]¶ Base class for converter objects. Apart from the constructor, this is an abstract class.
-
class
fontTools.ttLib.tables.otConverters.
CIDGlyphMap
(name, repeat, aux, tableClass=None)[source]¶ -
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
writeArray
(writer, font, tableDict, values)¶
-
-
class
fontTools.ttLib.tables.otConverters.
Char64
(name, repeat, aux, tableClass=None)[source]¶ An ASCII string with up to 64 characters.
Unused character positions are filled with 0x00 bytes. Used in Apple AAT fonts in the gcid table.
-
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 64¶
-
static
toString
(value)¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
CompositeMode
(name, repeat, aux, tableClass=None)[source]¶ -
enumClass
¶
-
classmethod
fromString
(value)¶
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 1¶
-
classmethod
toString
(value)¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
ComputedInt
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
static
toString
(value)¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
ComputedUInt8
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 1¶
-
static
toString
(value)¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
ComputedULong
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 4¶
-
static
toString
(value)¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
ComputedUShort
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 2¶
-
static
toString
(value)¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
DeciPoints
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 2¶
-
static
toString
(value)¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
DeltaValue
(name, repeat, aux, tableClass=None)[source]¶ -
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
writeArray
(writer, font, tableDict, values)¶
-
-
class
fontTools.ttLib.tables.otConverters.
ExtSubTable
(name, repeat, aux, tableClass=None)[source]¶ -
getConverter
(tableType, lookupType)¶
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
readOffset
(reader)¶
-
staticSize
= 4¶
-
writeArray
(writer, font, tableDict, values)¶
-
writeNullOffset
(writer)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
ExtendMode
(name, repeat, aux, tableClass=None)[source]¶ -
enumClass
¶
-
classmethod
fromString
(value)¶
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 1¶
-
classmethod
toString
(value)¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
F2Dot14
(name, repeat, aux, tableClass=None)[source]¶ -
-
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 2¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
FeatureParams
(name, repeat, aux, tableClass=None)[source]¶ -
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
readOffset
(reader)¶
-
staticSize
= 2¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
writeNullOffset
(writer)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
Fixed
(name, repeat, aux, tableClass=None)[source]¶ -
-
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 4¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
Flags32
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 4¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
FloatValue
(name, repeat, aux, tableClass=None)[source]¶ -
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
static
toString
(value)¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
GlyphCIDMap
(name, repeat, aux, tableClass=None)[source]¶ -
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
writeArray
(writer, font, tableDict, values)¶
-
-
class
fontTools.ttLib.tables.otConverters.
GlyphID
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
staticSize
= 2¶
-
static
toString
(value)¶
-
typecode
= 'H'¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
GlyphID32
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 4¶
-
static
toString
(value)¶
-
typecode
= 'L'¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
Int8
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 1¶
-
static
toString
(value)¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
IntValue
(name, repeat, aux, tableClass=None)[source]¶ -
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
static
toString
(value)¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
LTable
(name, repeat, aux, tableClass=None)[source]¶ -
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 4¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
Long
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 4¶
-
static
toString
(value)¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
LookupFlag
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 2¶
-
static
toString
(value)¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
MorxSubtableConverter
(name, repeat, aux)[source]¶ -
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
writeArray
(writer, font, tableDict, values)¶
-
-
class
fontTools.ttLib.tables.otConverters.
NameID
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 2¶
-
static
toString
(value)¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
STXHeader
(name, repeat, aux, tableClass)[source]¶ -
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
writeArray
(writer, font, tableDict, values)¶
-
-
class
fontTools.ttLib.tables.otConverters.
Short
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 2¶
-
static
toString
(value)¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
SimpleValue
(name, repeat, aux, tableClass=None)[source]¶ -
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
-
class
fontTools.ttLib.tables.otConverters.
Struct
(name, repeat, aux, tableClass=None)[source]¶ -
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
writeArray
(writer, font, tableDict, values)¶
-
-
class
fontTools.ttLib.tables.otConverters.
StructWithLength
(name, repeat, aux, tableClass=None)[source]¶ -
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
SubStruct
(name, repeat, aux, tableClass=None)[source]¶ -
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
-
class
fontTools.ttLib.tables.otConverters.
SubTable
(name, repeat, aux, tableClass=None)[source]¶ -
-
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
readOffset
(reader)¶
-
staticSize
= 2¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
writeNullOffset
(writer)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
-
class
fontTools.ttLib.tables.otConverters.
Table
(name, repeat, aux, tableClass=None)[source]¶ -
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 2¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
Table24
(name, repeat, aux, tableClass=None)[source]¶ -
getRecordSize
(reader)¶
-
read
(reader, font, tableDict)¶ Read a value from the reader.
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 3¶
-
write
(writer, font, tableDict, value, repeatIndex=None)¶ Write a value to the writer.
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
-
class
fontTools.ttLib.tables.otConverters.
Tag
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 4¶
-
static
toString
(value)¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
UInt24
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 3¶
-
static
toString
(value)¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class
fontTools.ttLib.tables.otConverters.
UInt8
(name, repeat, aux, tableClass=None)[source]¶ -
static
fromString
(value)¶
-
getRecordSize
(reader)¶
-
readArray
(reader, font, tableDict, count)¶ Read an array of values from the reader.
-
staticSize
= 1¶
-
static
toString
(value)¶
-
writeArray
(writer, font, tableDict, values)¶
-
xmlRead
(attrs, content, font)¶ Read a value from XML.
-
xmlWrite
(xmlWriter, font, value, name, attrs)¶ Write a value to XML.
-
static
-
class