builder.py: only sort ClassDefBuilder input glyphs if they are unsorted
This fixes broken tests after 9e76d16, and should finally close https://github.com/fonttools/fonttools/issues/766
This commit is contained in:
parent
3ff25948ef
commit
3b3e74f90b
@ -589,6 +589,9 @@ class ClassDefBuilder(object):
|
||||
self.useClass0_ = useClass0
|
||||
|
||||
def canAdd(self, glyphs):
|
||||
if isinstance(glyphs, (set, frozenset)):
|
||||
glyphs = tuple(sorted(glyphs))
|
||||
elif not isinstance(glyphs, tuple):
|
||||
glyphs = tuple(glyphs)
|
||||
if glyphs in self.classes_:
|
||||
return True
|
||||
@ -598,6 +601,9 @@ class ClassDefBuilder(object):
|
||||
return True
|
||||
|
||||
def add(self, glyphs):
|
||||
if isinstance(glyphs, (set, frozenset)):
|
||||
glyphs = tuple(sorted(glyphs))
|
||||
elif not isinstance(glyphs, tuple):
|
||||
glyphs = tuple(glyphs)
|
||||
if glyphs in self.classes_:
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user