Only use two-byte offsets in loca table if all offsets are even

Otherwise it will mess up.
This commit is contained in:
Behdad Esfahbod 2014-07-22 15:49:04 -04:00
parent 30ff4ab869
commit c6b031d661

View File

@ -34,7 +34,7 @@ class table__l_o_c_a(DefaultTable.DefaultTable):
except AttributeError:
self.set([])
max_location = 0
if max_location < 0x20000:
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)