Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _makeMarkFilteringSetClass(self, lookupName, attachments, markClass, include):
markGlyphs = (glyphName for glyphName in markClass.glyphs if include(glyphName))
baseGlyphs = (
pos.name for pos in attachments if pos.name not in markClass.glyphs
)
members = itertools.chain(markGlyphs, baseGlyphs)
className = "MFS_%s" % lookupName
return ast.makeGlyphClassDefinitions(
{className: members}, feaFile=self.context.feaFile
)[className]
def getKerningClasses(cls, font, feaFile=None, glyphSet=None):
side1Groups, side2Groups = cls.getKerningGroups(font, glyphSet)
side1Classes = ast.makeGlyphClassDefinitions(
side1Groups, feaFile, stripPrefix="public."
)
side2Classes = ast.makeGlyphClassDefinitions(
side2Groups, feaFile, stripPrefix="public."
)
return side1Classes, side2Classes
def getKerningClasses(cls, font, feaFile=None, glyphSet=None):
side1Groups, side2Groups = cls.getKerningGroups(font, glyphSet)
side1Classes = ast.makeGlyphClassDefinitions(
side1Groups, feaFile, stripPrefix="public."
)
side2Classes = ast.makeGlyphClassDefinitions(
side2Groups, feaFile, stripPrefix="public."
)
return side1Classes, side2Classes