def decompile(self, data, ttFont):
    if ((data is not None) and (ttFont is not None)):
        self.decompileHeader(data, ttFont)
    else:
        assert ((data is None) and (ttFont is None)), 'Need both data and ttFont arguments'
    data = self.data
    self.cmap = {}
    uvsDict = {}
    recOffset = 0
    for n in range(self.numVarSelectorRecords):
        (uvs, defOVSOffset, nonDefUVSOffset) = struct.unpack('>3sLL', data[recOffset:(recOffset + 11)])
        recOffset += 11
        varUVS = cvtToUVS(uvs)
        if defOVSOffset:
            startOffset = (defOVSOffset - 10)
            (numValues,) = struct.unpack('>L', data[startOffset:(startOffset + 4)])
            startOffset += 4
            for r in range(numValues):
                (uv, addtlCnt) = struct.unpack('>3sB', data[startOffset:(startOffset + 4)])
                startOffset += 4
                firstBaseUV = cvtToUVS(uv)
                cnt = (addtlCnt + 1)
                baseUVList = list(range(firstBaseUV, (firstBaseUV + cnt)))
                glyphList = ([None] * cnt)
                localUVList = zip(baseUVList, glyphList)
                try:
                    uvsDict[varUVS].extend(localUVList)
                except KeyError:
                    uvsDict[varUVS] = list(localUVList)
        if nonDefUVSOffset:
            startOffset = (nonDefUVSOffset - 10)
            (numRecs,) = struct.unpack('>L', data[startOffset:(startOffset + 4)])
            startOffset += 4
            localUVList = []
            for r in range(numRecs):
                (uv, gid) = struct.unpack('>3sH', data[startOffset:(startOffset + 5)])
                startOffset += 5
                uv = cvtToUVS(uv)
                glyphName = self.ttFont.getGlyphName(gid)
                localUVList.append([uv, glyphName])
            try:
                uvsDict[varUVS].extend(localUVList)
            except KeyError:
                uvsDict[varUVS] = localUVList
    self.uvsDict = uvsDict
def decompile(self, data, ttFont):
    if ((data is not None) and (ttFont is not None)):
        self.decompileHeader(data, ttFont)
    else:
        assert ((data is None) and (ttFont is None)), 'Need both data and ttFont arguments'
    data = self.data
    self.cmap = {}
    uvsDict = {}
    recOffset = 0
    for n in range(self.numVarSelectorRecords):
        (uvs, defOVSOffset, nonDefUVSOffset) = struct.unpack('>3sLL', data[recOffset:(recOffset + 11)])
        recOffset += 11
        varUVS = cvtToUVS(uvs)
        if defOVSOffset:
            startOffset = (defOVSOffset - 10)
            (numValues,) = struct.unpack('>L', data[startOffset:(startOffset + 4)])
            startOffset += 4
            for r in range(numValues):
                (uv, addtlCnt) = struct.unpack('>3sB', data[startOffset:(startOffset + 4)])
                startOffset += 4
                firstBaseUV = cvtToUVS(uv)
                cnt = (addtlCnt + 1)
                baseUVList = list(range(firstBaseUV, (firstBaseUV + cnt)))
                glyphList = ([None] * cnt)
                localUVList = zip(baseUVList, glyphList)
                try:
                    uvsDict[varUVS].extend(localUVList)
                except KeyError:
                    uvsDict[varUVS] = list(localUVList)
        if nonDefUVSOffset:
            startOffset = (nonDefUVSOffset - 10)
            (numRecs,) = struct.unpack('>L', data[startOffset:(startOffset + 4)])
            startOffset += 4
            localUVList = []
            for r in range(numRecs):
                (uv, gid) = struct.unpack('>3sH', data[startOffset:(startOffset + 5)])
                startOffset += 5
                uv = cvtToUVS(uv)
                glyphName = self.ttFont.getGlyphName(gid)
                localUVList.append([uv, glyphName])
            try:
                uvsDict[varUVS].extend(localUVList)
            except KeyError:
                uvsDict[varUVS] = localUVList
    self.uvsDict = uvsDict