Skip to content

Commit

Permalink
Merge pull request #72 from khaledhosny/groups-glyph-order
Browse files Browse the repository at this point in the history
Try to keep the glyph order in kerning groups
  • Loading branch information
anthrotype authored Oct 1, 2017
2 parents 9038a9f + 0905384 commit 5d1a490
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/fontMath/mathKerning.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ def _processMathOne(self, other, funct):
kerning[k] = v
g1 = self.groups()
g2 = other.groups()
if g1 == g2:
groups = g1
if g1 == g2 or not g1 or not g2:
groups = g1 or g2
else:
comboGroups = set(g1.keys()) | set(g2.keys())
groups = dict.fromkeys(comboGroups, None)
for groupName in comboGroups:
s1 = set(g1.get(groupName, []))
s2 = set(g2.get(groupName, []))
groups[groupName] = list(s1 | s2)
groups[groupName] = sorted(list(s1 | s2))
ks = MathKerning(kerning, groups)
return ks

Expand Down

0 comments on commit 5d1a490

Please sign in to comment.