_l_o_c_a.py 文件源码

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

项目:otRebuilder 作者: Pal3love 项目源码 文件源码
def compile(self, ttFont):
        try:
            max_location = max(self.locations)
        except AttributeError:
            self.set([])
            max_location = 0
        if max_location < 0x20000 and all(l % 2 == 0 for l in self.locations):
            locations = array.array("H")
            for i in range(len(self.locations)):
                locations.append(self.locations[i] // 2)
            ttFont['head'].indexToLocFormat = 0
        else:
            locations = array.array("I", self.locations)
            ttFont['head'].indexToLocFormat = 1
        if sys.byteorder != "big":
            locations.byteswap()
        return locations.tostring()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号