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

ttLib.tables.ttProgram.py -- Assembler/disassembler for TrueType bytecode programs.

 
Modules
       
array
re
string

 
Classes
       
Program

 
class Program
     Methods defined here:
__init__(self)
fromAssembly(self, assembly)
fromBytecode(self, bytecode)
fromXML(self, (name, attrs, content), ttFont)
getAssembly(self)
getBytecode(self)
toXML(self, writer, ttFont)

 
Functions
       
_makeDict(instructionList)
_skipWhite(data, pos, _whiteRE=<_sre.SRE_Pattern object at 0x7e08030>)
bitRepr(value, bits)

 
Data
        __file__ = '/home/mcfletch/pylive/fontTools/ttLib/tables/ttProgram.pyc'
__name__ = 'fontTools.ttLib.tables.ttProgram'
__package__ = 'fontTools.ttLib.tables'
_comment = r'/\*.*?\*/'
_instruction = r'([A-Z][A-Z0-9]*)\s*\[(.*?)\]'
_mnemonicPat = <_sre.SRE_Pattern object at 0x7d82618>
_number = '-?[0-9]+'
_pushCountPat = <_sre.SRE_Pattern object at 0x7e68a60>
_token = r'(([A-Z][A-Z0-9]*)\s*\[(.*?)\])|(-?[0-9]+)|(/\*.*?\*/)'
_tokenRE = <_sre.SRE_Pattern object at 0x7e677e0>
_whiteRE = <_sre.SRE_Pattern object at 0x7e08030>
instructions = [(127, 'AA', 0, 'AdjustAngle', 1, 0), (100, 'ABS', 0, 'Absolute', 1, 1), (96, 'ADD', 0, 'Add', 2, 1), (39, 'ALIGNPTS', 0, 'AlignPts', 2, 0), (60, 'ALIGNRP', 0, 'AlignRelativePt', -1, 0), (90, 'AND', 0, 'LogicalAnd', 2, 1), (43, 'CALL', 0, 'CallFunction', 1, 0), (103, 'CEILING', 0, 'Ceiling', 1, 1), (37, 'CINDEX', 0, 'CopyXToTopStack', 1, 1), (34, 'CLEAR', 0, 'ClearStack', -1, 0), (79, 'DEBUG', 0, 'DebugCall', 1, 0), (115, 'DELTAC1', 0, 'DeltaExceptionC1', -1, 0), (116, 'DELTAC2', 0, 'DeltaExceptionC2', -1, 0), (117, 'DELTAC3', 0, 'DeltaExceptionC3', -1, 0), (93, 'DELTAP1', 0, 'DeltaExceptionP1', -1, 0), (113, 'DELTAP2', 0, 'DeltaExceptionP2', -1, 0), (114, 'DELTAP3', 0, 'DeltaExceptionP3', -1, 0), (36, 'DEPTH', 0, 'GetDepthStack', 0, 1), (98, 'DIV', 0, 'Divide', 2, 1), (32, 'DUP', 0, 'DuplicateTopStack', 1, 2), ...]
mnemonicDict = {'AA': (127, 0, 'AdjustAngle'), 'ABS': (100, 0, 'Absolute'), 'ADD': (96, 0, 'Add'), 'ALIGNPTS': (39, 0, 'AlignPts'), 'ALIGNRP': (60, 0, 'AlignRelativePt'), 'AND': (90, 0, 'LogicalAnd'), 'CALL': (43, 0, 'CallFunction'), 'CEILING': (103, 0, 'Ceiling'), 'CINDEX': (37, 0, 'CopyXToTopStack'), 'CLEAR': (34, 0, 'ClearStack'), ...}
opcodeDict = {0: ('SVTCA', 1, 0, 'SetFPVectorToAxis'), 1: ('SVTCA', 1, 0, 'SetFPVectorToAxis'), 2: ('SPVTCA', 1, 2, 'SetPVectorToAxis'), 3: ('SPVTCA', 1, 2, 'SetPVectorToAxis'), 4: ('SFVTCA', 1, 4, 'SetFVectorToAxis'), 5: ('SFVTCA', 1, 4, 'SetFVectorToAxis'), 6: ('SPVTL', 1, 6, 'SetPVectorToLine'), 7: ('SPVTL', 1, 6, 'SetPVectorToLine'), 8: ('SFVTL', 1, 8, 'SetFVectorToLine'), 9: ('SFVTL', 1, 8, 'SetFVectorToLine'), ...}
streamInstructions = [(64, 'NPUSHB', 0, 'PushNBytes', 0, -1), (65, 'NPUSHW', 0, 'PushNWords', 0, -1), (176, 'PUSHB', 3, 'PushBytes', 0, -1), (184, 'PUSHW', 3, 'PushWords', 0, -1)]
streamMnemonicDict = {'NPUSHB': (64, 0, 'PushNBytes'), 'NPUSHW': (65, 0, 'PushNWords'), 'PUSHB': (176, 3, 'PushBytes'), 'PUSHW': (184, 3, 'PushWords')}
streamOpcodeDict = {64: ('NPUSHB', 0, 0, 'PushNBytes'), 65: ('NPUSHW', 0, 0, 'PushNWords'), 176: ('PUSHB', 3, 176, 'PushBytes'), 177: ('PUSHB', 3, 176, 'PushBytes'), 178: ('PUSHB', 3, 176, 'PushBytes'), 179: ('PUSHB', 3, 176, 'PushBytes'), 180: ('PUSHB', 3, 176, 'PushBytes'), 181: ('PUSHB', 3, 176, 'PushBytes'), 182: ('PUSHB', 3, 176, 'PushBytes'), 183: ('PUSHB', 3, 176, 'PushBytes'), ...}
tt_instructions_error = 'TT instructions error'