Skip to content

Commit

Permalink
order opentype features by their state
Browse files Browse the repository at this point in the history
make sure to set the off state features first
  • Loading branch information
typemytype committed Jan 20, 2017
1 parent 32e9a94 commit 853d42f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drawBot/context/baseContext.py
Expand Up @@ -864,7 +864,10 @@ def append(self, txt, **kwargs):
warnings.warn("font: %s is not installed, back to the fallback font: %s" % (fontName, ff))
font = AppKit.NSFont.fontWithName_size_(ff, self._fontSize)
coreTextfeatures = []
for featureTag, value in self._openTypeFeatures.items():
# sort features by their on/off state
# set all disabled features first
orderedOpenTypeFeatures = sorted(self._openTypeFeatures.items(), key=lambda (k, v): v)
for featureTag, value in orderedOpenTypeFeatures:
if not value:
featureTag = "%s_off" % featureTag
if featureTag in openType.featureMap:
Expand Down

0 comments on commit 853d42f

Please sign in to comment.