Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _defineMarkClass(self, glyphName, x, y, className, markClasses):
anchor = ast.Anchor(x=otRound(x), y=otRound(y))
markClass = markClasses.get(className)
if markClass is None:
markClass = ast.MarkClass(className)
markClasses[className] = markClass
else:
if glyphName in markClass.glyphs:
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
def _makeAnchorFormatA(x, y):
return ast.Anchor(x=otRound(x), y=otRound(y))
def _marksAsAST(self):
return [
(ast.Anchor(x=otRound(anchor.x), y=otRound(anchor.y)), anchor.markClass)
for anchor in sorted(self.marks, key=lambda a: a.name)
]
def _marksAsAST(self):
return [
[
(ast.Anchor(x=otRound(anchor.x), y=otRound(anchor.y)), anchor.markClass)
for anchor in sorted(component, key=lambda a: a.name)
]
for component in self.marks
]