Skip to content

Commit

Permalink
Check for contextual anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Nov 1, 2023
1 parent 6a8b290 commit 554ac19
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Lib/fontmake/compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ def check_glyph(self, glyphs):
anchors,
"anchors",
)
# Context for contextual anchors
libs = [g.lib for g in glyphs]
for ix, anchors in enumerate(zip(*anchors)):
if anchors[0].name[0] == "*":
objectlibs = [
libs[font_ix]
.get("public.objectLibs", {})
.get(anchor.identifier, {})
for font_ix, anchor in enumerate(anchors)
]
with Context(self, f"anchor {anchors[0].name}"):
self.ensure_all_same(
lambda lib: lib.get("GPOS_Context", "None").strip(),
objectlibs,
"GPOS context",
)

components = [g.components for g in glyphs]
if self.ensure_all_same(len, components, "number of components"):
Expand Down

0 comments on commit 554ac19

Please sign in to comment.