Skip to content

Commit

Permalink
Try to get more specific rules in first
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Jun 28, 2023
1 parent cf35520 commit e3a4edf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Lib/glyphsLib/featureWriters/markFeatureWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,12 @@ def _makeFeatures(self):
]

dispatch_lookups = {}
for ix, (fullcontext, glyph_anchor_pair) in enumerate(by_context.items()):
# We sort the full context by longest first. This isn't perfect
# but it gives us the best chance that more specific contexts
# (typically longer) will take precedence over more general ones.
for ix, (fullcontext, glyph_anchor_pair) in enumerate(
sorted(by_context.items(), key=lambda x: -len(x[0]))
):
# Make the contextual lookup
lookupname = "ContextualMark_%i" % ix
if ";" in fullcontext:
Expand Down

0 comments on commit e3a4edf

Please sign in to comment.