Avoid string copies when parsing 'gvar' table

This commit is contained in:
Sascha Brawer 2015-04-23 11:44:52 +02:00
parent 674fb52c37
commit 37e9e04f0b

View File

@ -41,6 +41,7 @@ class table__g_v_a_r(DefaultTable.DefaultTable):
dependencies = ["fvar", "glyf"]
def decompile(self, data, ttFont):
data = buffer(data) # We do a lot of slicing; no need to copy all those sub-buffers.
axisTags = [axis.AxisTag for axis in ttFont['fvar'].table.VariationAxis]
glyphs = ttFont.getGlyphOrder()
sstruct.unpack(GVAR_HEADER_FORMAT, data[0:GVAR_HEADER_SIZE], self)