_l_o_c_a.py 文件源码

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

项目:otRebuilder 作者: Pal3love 项目源码 文件源码
def decompile(self, data, ttFont):
        longFormat = ttFont['head'].indexToLocFormat
        if longFormat:
            format = "I"
        else:
            format = "H"
        locations = array.array(format)
        locations.fromstring(data)
        if sys.byteorder != "big":
            locations.byteswap()
        if not longFormat:
            l = array.array("I")
            for i in range(len(locations)):
                l.append(locations[i] * 2)
            locations = l
        if len(locations) < (ttFont['maxp'].numGlyphs + 1):
            log.warning("corrupt 'loca' table, or wrong numGlyphs in 'maxp': %d %d",
                len(locations) - 1, ttFont['maxp'].numGlyphs)
        self.locations = locations
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号