Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if accentName in markClass.glyphs:
mcdef = markClass.glyphs[accentName]
if cls._anchorsAreEqual(anchor, mcdef.anchor):
logger.debug(
"Glyph %s already defined in markClass @%s",
accentName,
className,
)
return None
else:
# same accent glyph defined with different anchors for the
# same markClass; make a new unique markClass definition
newClassName = ast.makeFeaClassName(className, markClasses)
markClass = ast.MarkClass(newClassName)
markClasses[newClassName] = markClass
mcdef = ast.MarkClassDefinition(markClass, anchor, glyphs)
markClass.addDefinition(mcdef)
return mcdef
mcdef = markClass.glyphs[glyphName]
if self._anchorsAreEqual(anchor, mcdef.anchor):
self.log.debug(
"Glyph %s already defined in markClass @%s",
glyphName,
className,
)
return None
else:
# same mark glyph defined with different anchors for the
# same markClass; make a new unique markClass definition
newClassName = ast.makeFeaClassName(className, markClasses)
markClass = ast.MarkClass(newClassName)
markClasses[newClassName] = markClass
glyphName = ast.GlyphName(glyphName)
mcdef = ast.MarkClassDefinition(markClass, anchor, glyphName)
markClass.addDefinition(mcdef)
return mcdef