fontTools.ttLib.tables.otBase
index
/home/mcfletch/pylive/fontTools/ttLib/tables/otBase.py

 
Modules
       
fontTools.ttLib.tables.otData
struct

 
Classes
       
Exception(BaseException)
OTLOffsetOverflowError
DefaultTable
BaseTTXConverter
BaseTable
FormatSwitchingBaseTable
CountReference
OTTableReader
OTTableWriter
OverflowErrorRecord
TableStack
ValueRecord
ValueRecordFactory

 
class BaseTTXConverter(DefaultTable)
    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.
 
  Methods defined here:
compile(self, font)
Create a top-level OTFWriter 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(self, data, font)
fromXML(self, (name, attrs, content), font)
toXML(self, writer, font)

Methods inherited from DefaultTable:
__cmp__(self, other)
__init__(self, tag)
__repr__(self)

Data and other attributes inherited from DefaultTable:
dependencies = []

 
class BaseTable
     Methods defined here:
__cmp__(self, other)
__getattr__(self, attr)
__init__(self)
compile(self, writer, font, tableStack=None)
decompile(self, reader, font, tableStack=None)
fromXML(self, (name, attrs, content), font)
getConverterByName(self, name)
getConverters(self)
postRead(self, table, font)
preCompile(self)
preWrite(self, font)
readFormat(self, reader)
toXML(self, xmlWriter, font, attrs=None)
toXML2(self, xmlWriter, font)
writeFormat(self, writer)

 
class CountReference
    A reference to a Count value, not a count of references.
 
  Methods defined here:
__init__(self, table, name)
getCountData(self)

 
class FormatSwitchingBaseTable(BaseTable)
    Minor specialization of BaseTable, for tables that have multiple
formats, eg. CoverageFormat1 vs. CoverageFormat2.
 
  Methods defined here:
getConverterByName(self, name)
getConverters(self)
readFormat(self, reader)
writeFormat(self, writer)

Methods inherited from BaseTable:
__cmp__(self, other)
__getattr__(self, attr)
__init__(self)
compile(self, writer, font, tableStack=None)
decompile(self, reader, font, tableStack=None)
fromXML(self, (name, attrs, content), font)
postRead(self, table, font)
preCompile(self)
preWrite(self, font)
toXML(self, xmlWriter, font, attrs=None)
toXML2(self, xmlWriter, font)

 
class OTLOffsetOverflowError(Exception)
    
Method resolution order:
OTLOffsetOverflowError
Exception
BaseException
object

Methods defined here:
__init__(self, overflowErrorRecord)
__str__(self)

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from Exception:
__new__ = <built-in method __new__ of type object at 0x8108c0>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from BaseException:
__dict__
args
message

 
class OTTableReader
    Helper class to retrieve data from an OpenType table.
 
  Methods defined here:
__init__(self, data, tableType, offset=0, valueFormat=None, cachingStats=None)
getSubReader(self, offset)
readLong(self)
readShort(self)
readStruct(self, format, size=None)
readTag(self)
readULong(self)
readUShort(self)
readValueRecord(self, font, which)
setValueFormat(self, format, which)

 
class OTTableWriter
    Helper class to gather and assemble data for OpenType tables.
 
  Methods defined here:
__cmp__(self, other)
__hash__(self)
__init__(self, tableType, valueFormat=None)
getAllData(self)
Assemble all data, including all subtables.
getData(self)
Assemble the data for this writer/table, without subtables.
getDataLength(self)
Return the length of this table in bytes, without subtables.
getOverflowErrorRecord(self, item)
getSubWriter(self)
setValueFormat(self, format, which)
writeCountReference(self, table, name)
writeData(self, data)
writeLong(self, value)
writeShort(self, value)
writeStruct(self, format, values)
writeSubTable(self, subWriter)
writeTag(self, tag)
writeULong(self, value)
writeUShort(self, value)
writeValueRecord(self, value, font, which)

 
class OverflowErrorRecord
     Methods defined here:
__init__(self, overflowTuple)
__repr__(self)

 
class TableStack
    A stack of table dicts, working as a stack of namespaces so we can
retrieve values from (and store values to) tables higher up the stack.
 
  Methods defined here:
__init__(self)
getTop(self)
getValue(self, name)
pop(self)
push(self, table)
storeValue(self, name, value)

 
class ValueRecord
     Methods defined here:
__cmp__(self, other)
fromXML(self, (name, attrs, content), font)
getFormat(self)
toXML(self, xmlWriter, font, valueName, attrs=None)

 
class ValueRecordFactory
    Given a format code, this object convert ValueRecords.
 
  Methods defined here:
readValueRecord(self, reader, font)
setFormat(self, valueFormat)
writeValueRecord(self, writer, font, valueRecord)

 
Functions
       
_buildDict()
packULong(value)
packUShort(value)

 
Data
        __file__ = '/home/mcfletch/pylive/fontTools/ttLib/tables/otBase.pyc'
__name__ = 'fontTools.ttLib.tables.otBase'
__package__ = 'fontTools.ttLib.tables'
valueRecordFormat = [(1, 'XPlacement', 0, 1), (2, 'YPlacement', 0, 1), (4, 'XAdvance', 0, 1), (8, 'YAdvance', 0, 1), (16, 'XPlaDevice', 1, 0), (32, 'YPlaDevice', 1, 0), (64, 'XAdvDevice', 1, 0), (128, 'YAdvDevice', 1, 0), (256, 'Reserved1', 0, 0), (512, 'Reserved2', 0, 0), (1024, 'Reserved3', 0, 0), (2048, 'Reserved4', 0, 0), (4096, 'Reserved5', 0, 0), (8192, 'Reserved6', 0, 0), (16384, 'Reserved7', 0, 0), (32768, 'Reserved8', 0, 0)]
valueRecordFormatDict = {'Reserved1': (256, 0, 0), 'Reserved2': (512, 0, 0), 'Reserved3': (1024, 0, 0), 'Reserved4': (2048, 0, 0), 'Reserved5': (4096, 0, 0), 'Reserved6': (8192, 0, 0), 'Reserved7': (16384, 0, 0), 'Reserved8': (32768, 0, 0), 'XAdvDevice': (64, 1, 0), 'XAdvance': (4, 0, 1), ...}