def _unpack(stream):
# L = unsignedlong 4 bytes
while True:
head = stream.read(8)
if not head:
break
jsonlen, fontlen = struct.unpack('II', head)
desc = json.loads(stream.read(jsonlen).decode('utf-8'))
font = TTFont(BytesIO(stream.read(fontlen)))
yield (desc, font)
评论列表
文章目录