Use slots for OTTableReader
Slight performance gain even.
This commit is contained in:
parent
6e556aafc3
commit
3879cf9439
@ -84,9 +84,11 @@ class BaseTTXConverter(DefaultTable):
|
|||||||
self.table.fromXML((name, attrs, content), font)
|
self.table.fromXML((name, attrs, content), font)
|
||||||
|
|
||||||
|
|
||||||
class OTTableReader:
|
class OTTableReader(object):
|
||||||
|
|
||||||
"""Helper class to retrieve data from an OpenType table."""
|
"""Helper class to retrieve data from an OpenType table."""
|
||||||
|
|
||||||
|
__slots__ = ('data', 'offset', 'pos', 'tableType', 'valueFormat', 'cachingStats')
|
||||||
|
|
||||||
def __init__(self, data, tableType, offset=0, valueFormat=None, cachingStats=None):
|
def __init__(self, data, tableType, offset=0, valueFormat=None, cachingStats=None):
|
||||||
self.data = data
|
self.data = data
|
||||||
@ -164,7 +166,7 @@ class OTTableReader:
|
|||||||
return self.valueFormat[which].readValueRecord(self, font)
|
return self.valueFormat[which].readValueRecord(self, font)
|
||||||
|
|
||||||
|
|
||||||
class OTTableWriter:
|
class OTTableWriter(object):
|
||||||
|
|
||||||
"""Helper class to gather and assemble data for OpenType tables."""
|
"""Helper class to gather and assemble data for OpenType tables."""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user