Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[markFeatureWriter] Drop “ambiguously connected” info message #892

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
23 changes: 0 additions & 23 deletions Lib/ufo2ft/featureWriters/markFeatureWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,28 +550,6 @@ def _groupMarkClasses(self, markGlyphToMarkClasses):
),
)

def _logIfAmbiguous(self, attachments, groupedMarkClasses):
"""Warn about ambiguous situations and log the current resolution.
An anchor attachment is ambiguous if for the same mark glyph, more
than one mark class can be used to attach it to the base.
"""
for attachment in attachments:
for markGlyph, markClasses in attachment.getMarkGlyphToMarkClasses():
if len(markClasses) > 1:
self.log.info(
"The base glyph %s and mark glyph %s are ambiguously "
"connected by several anchor classes: %s. "
"The last one will prevail.",
attachment.name,
markGlyph,
", ".join(
markClass
for group in groupedMarkClasses
for markClass in group
if markClass in markClasses
),
)

def _removeClassPrefix(self, markClass):
assert markClass.startswith(self.markClassPrefix)
return markClass[len(self.markClassPrefix) :]
Expand Down Expand Up @@ -613,7 +591,6 @@ def _groupAttachments(self, attachments):
[markClass.name]
for _, markClass in sorted(self.context.markClasses.items())
]
self._logIfAmbiguous(attachments, groupedMarkClasses)
lookups = []
for markClasses in groupedMarkClasses:
lookup = []
Expand Down
6 changes: 0 additions & 6 deletions tests/featureWriters/markFeatureWriter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1685,12 +1685,6 @@ def test_multiple_anchor_classes_conflict_warning(

generated = self.writeFeatures(ufo, groupMarkClasses=groupMarkClasses)

assert (
"The base glyph a and mark glyph acutecomb are ambiguously "
f"connected by several anchor classes: {warning}. "
"The last one will prevail." in caplog.text
)

assert str(generated) == expected

def test_skipExportGlyphs(self, testufo):
Expand Down