G_P_K_G_.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:otRebuilder 作者: Pal3love 项目源码 文件源码
def decompile(self, data, ttFont):
        dummy, newData = sstruct.unpack2(GPKGFormat, data, self)

        GMAPoffsets = array.array("I")
        endPos = (self.numGMAPs+1) * 4
        GMAPoffsets.fromstring(newData[:endPos])
        if sys.byteorder != "big":
            GMAPoffsets.byteswap()
        self.GMAPs = []
        for i in range(self.numGMAPs):
            start = GMAPoffsets[i]
            end = GMAPoffsets[i+1]
            self.GMAPs.append(data[start:end])
        pos = endPos
        endPos = pos + (self.numGlyplets + 1)*4
        glyphletOffsets = array.array("I")
        glyphletOffsets.fromstring(newData[pos:endPos])
        if sys.byteorder != "big":
            glyphletOffsets.byteswap()
        self.glyphlets = []
        for i in range(self.numGlyplets):
            start = glyphletOffsets[i]
            end = glyphletOffsets[i+1]
            self.glyphlets.append(data[start:end])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号