Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Lib/ufo2ft/filters/optimizeAnchors.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ def filter(self, glyph):
# We're a base!
return False

# More sanity checks: skip over spacing marks
if glyph.width != 0:
return False
# Also skip over marks which are deliberately positioned over the
# previous glyphs
if glyph.getBounds().xMax < 0:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a heuristic as to guess whether a mark was "deliberately positioned over the previous glyph", I think this is a bit too fragile. It's conceivable that the xMax still be >= 0 while the mark being intentionally designed to fall on top of another (e.g. narrow) base glyph

return False

# We are a mark glyph with (at least) one attachment point.
theanchor = glyph.anchors[0]
self.context.matrix = Identity.translate(-theanchor.x, -theanchor.y)
Expand Down