def compile(self, ttFont):
    if self.data:
        return (struct.pack('>HHH', 0, 262, self.language) + self.data)
    charCodeList = sorted(self.cmap.items())
    charCodes = [entry[0] for entry in charCodeList]
    valueList = [entry[1] for entry in charCodeList]
    assert (charCodes == list(range(256)))
    valueList = map(ttFont.getGlyphID, valueList)
    glyphIdArray = array.array('B', valueList)
    data = (struct.pack('>HHH', 0, 262, self.language) + glyphIdArray.tostring())
    assert (len(data) == 262)
    return data
def compile(self, ttFont):
    if self.data:
        return (struct.pack('>HHH', 0, 262, self.language) + self.data)
    charCodeList = sorted(self.cmap.items())
    charCodes = [entry[0] for entry in charCodeList]
    valueList = [entry[1] for entry in charCodeList]
    assert (charCodes == list(range(256)))
    valueList = map(ttFont.getGlyphID, valueList)
    glyphIdArray = array.array('B', valueList)
    data = (struct.pack('>HHH', 0, 262, self.language) + glyphIdArray.tostring())
    assert (len(data) == 262)
    return data