Skip to content

Commit

Permalink
Merge pull request #892 from googlefonts/drop-log-if-ambiguous
Browse files Browse the repository at this point in the history
[markFeatureWriter] Drop “ambiguously connected” info message
  • Loading branch information
khaledhosny authored Jan 8, 2025
2 parents 673e8e3 + afd7e4f commit 4158391
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
23 changes: 0 additions & 23 deletions Lib/ufo2ft/featureWriters/markFeatureWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,28 +551,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 @@ -614,7 +592,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

0 comments on commit 4158391

Please sign in to comment.