def compile(self, ttFont):
    self.tables.sort()
    numSubTables = len(self.tables)
    totalOffset = (4 + (8 * numSubTables))
    data = struct.pack('>HH', self.tableVersion, numSubTables)
    tableData = b''
    seen = {}
    done = {}
    for table in self.tables:
        try:
            offset = seen[id(table.cmap)]
        except KeyError:
            chunk = table.compile(ttFont)
            if (chunk in done):
                offset = done[chunk]
            else:
                offset = seen[id(table.cmap)] = done[chunk] = (totalOffset + len(tableData))
                tableData = (tableData + chunk)
        data = (data + struct.pack('>HHl', table.platformID, table.platEncID, offset))
    return (data + tableData)
def compile(self, ttFont):
    self.tables.sort()
    numSubTables = len(self.tables)
    totalOffset = (4 + (8 * numSubTables))
    data = struct.pack('>HH', self.tableVersion, numSubTables)
    tableData = b
    seen = {}
    done = {}
    for table in self.tables:
        try:
            offset = seen[id(table.cmap)]
        except KeyError:
            chunk = table.compile(ttFont)
            if (chunk in done):
                offset = done[chunk]
            else:
                offset = seen[id(table.cmap)] = done[chunk] = (totalOffset + len(tableData))
                tableData = (tableData + chunk)
        data = (data + struct.pack('>HHl', table.platformID, table.platEncID, offset))
    return (data + tableData)