def compile(self, ttFont):
    if self.data:
        return (struct.pack('>HHH', self.format, self.length, self.language) + self.data)
    cmap = self.cmap
    codes = list(cmap.keys())
    if codes:
        codes = list(range(codes[0], (codes[(- 1)] + 1)))
        firstCode = codes[0]
        valueList = [cmap.get(code, '.notdef') for code in codes]
        valueList = map(ttFont.getGlyphID, valueList)
        glyphIndexArray = array.array('H', valueList)
        if (sys.byteorder != 'big'):
            glyphIndexArray.byteswap()
        data = glyphIndexArray.tostring()
    else:
        data = b''
        firstCode = 0
    header = struct.pack('>HHHHH', 6, (len(data) + 10), self.language, firstCode, len(codes))
    return (header + data)
def compile(self, ttFont):
    if self.data:
        return (struct.pack('>HHH', self.format, self.length, self.language) + self.data)
    cmap = self.cmap
    codes = list(cmap.keys())
    if codes:
        codes = list(range(codes[0], (codes[(- 1)] + 1)))
        firstCode = codes[0]
        valueList = [cmap.get(code, '.notdef') for code in codes]
        valueList = map(ttFont.getGlyphID, valueList)
        glyphIndexArray = array.array('H', valueList)
        if (sys.byteorder != 'big'):
            glyphIndexArray.byteswap()
        data = glyphIndexArray.tostring()
    else:
        data = b
        firstCode = 0
    header = struct.pack('>HHHHH', 6, (len(data) + 10), self.language, firstCode, len(codes))
    return (header + data)