Skip to content

Commit

Permalink
Use getAnchor to get variable ligcarets
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Dec 7, 2023
1 parent a8f050d commit b49f998
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Lib/ufo2ft/featureWriters/gdefFeatureWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,21 @@ def _getLigatureCarets(self):
and anchor.name.startswith("caret_")
and anchor.x is not None
):
glyphCarets.add(round(anchor.x))
glyphCarets.add(self._getAnchor(glyphName, anchor.name)[0])
elif (
anchor.name
and anchor.name.startswith("vcaret_")
and anchor.y is not None
):
glyphCarets.add(round(anchor.y))
glyphCarets.add(self._getAnchor(glyphName, anchor.name)[1])

if glyphCarets:
carets[glyphName] = sorted(glyphCarets)
if self.context.isVariable:
carets[glyphName] = sorted(
glyphCarets, key=lambda caret: list(caret.values.values())[0]
)
else:
carets[glyphName] = sorted(glyphCarets)

return carets

Expand Down

0 comments on commit b49f998

Please sign in to comment.