Avoid string copies when parsing 'gvar' table
This commit is contained in:
parent
674fb52c37
commit
37e9e04f0b
@ -41,6 +41,7 @@ class table__g_v_a_r(DefaultTable.DefaultTable):
|
|||||||
dependencies = ["fvar", "glyf"]
|
dependencies = ["fvar", "glyf"]
|
||||||
|
|
||||||
def decompile(self, data, ttFont):
|
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]
|
axisTags = [axis.AxisTag for axis in ttFont['fvar'].table.VariationAxis]
|
||||||
glyphs = ttFont.getGlyphOrder()
|
glyphs = ttFont.getGlyphOrder()
|
||||||
sstruct.unpack(GVAR_HEADER_FORMAT, data[0:GVAR_HEADER_SIZE], self)
|
sstruct.unpack(GVAR_HEADER_FORMAT, data[0:GVAR_HEADER_SIZE], self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user