From 2cfc16a17259b6b03c04082c12007912f71618e9 Mon Sep 17 00:00:00 2001 From: Martin Hosken Date: Tue, 6 Nov 2018 15:21:32 +0700 Subject: [PATCH] Remove redundant bug fix, add graphite dependencies --- Lib/fontTools/ttLib/sfnt.py | 1 - Lib/fontTools/ttLib/tables/G__l_a_t.py | 4 ++-- setup.py | 4 ++++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Lib/fontTools/ttLib/sfnt.py b/Lib/fontTools/ttLib/sfnt.py index afcd9c671..6dc48baf5 100644 --- a/Lib/fontTools/ttLib/sfnt.py +++ b/Lib/fontTools/ttLib/sfnt.py @@ -556,7 +556,6 @@ def calcChecksum(data): 3655064932 """ remainder = len(data) % 4 - data = data[:] # py3 data is a bytearray so copy it before modifying if remainder: data += b"\0" * (4 - remainder) value = 0 diff --git a/Lib/fontTools/ttLib/tables/G__l_a_t.py b/Lib/fontTools/ttLib/tables/G__l_a_t.py index 69b3ee3d8..7d1f73504 100644 --- a/Lib/fontTools/ttLib/tables/G__l_a_t.py +++ b/Lib/fontTools/ttLib/tables/G__l_a_t.py @@ -141,8 +141,8 @@ class table_G__l_a_t(DefaultTable.DefaultTable): def compileAttributes12(self, attrs, fmt): data = b"" for e in grUtils.entries(attrs): - data += sstruct.pack(fmt, {'attNum' : e[0], 'num' : e[1]}) - data += struct.pack(('>%dh' % len(e[2])), *e[2]) + data += sstruct.pack(fmt, {'attNum' : e[0], 'num' : e[1]}) + \ + struct.pack(('>%dh' % len(e[2])), *e[2]) return data def compileAttributes3(self, attrs): diff --git a/setup.py b/setup.py index c2f6a332f..e013098ba 100755 --- a/setup.py +++ b/setup.py @@ -58,6 +58,10 @@ extras_require = { "python_version < '3.7' and platform_python_implementation != 'PyPy'" ), ], + # for graphite type tables in ttLib/tables (Silf, Glat, Gloc) + "graphite": [ + "lz4 >= 1.7.4.2" + ], # for fontTools.interpolatable: to solve the "minimum weight perfect # matching problem in bipartite graphs" (aka Assignment problem) "interpolatable": [