[varLib.builder] fix calculation of VarData.NumShorts

The problem was that `break` statement: we stopped searching for SHORT columns in each delta set after finding the first, but rows can contain more than one in any order.

Fixes https://github.com/googlei18n/fontmake/issues/271
This commit is contained in:
Cosimo Lupo 2017-03-10 12:38:50 +00:00
parent 989270afc5
commit b2825ff6b3
No known key found for this signature in database
GPG Key ID: B61AAAD0B53A6419

View File

@ -44,10 +44,8 @@ def calculateNumShorts(self, optimize=True):
items = self.Item
narrows = set(range(count))
for item in items:
for i in narrows:
if not (-128 <= item[i] <= 127):
narrows.remove(i)
break
wides = [i for i in narrows if not (-128 <= item[i] <= 127)]
narrows.difference_update(wides)
if not narrows:
break
if optimize: