check-googlefonts: Updated Warn message for com_google_fonts_test_075
The previous implementation would produced incredibly long messages for
handwitten or display fonts. It would unnecessarily repeat the lengthy
description of why this error happens for each glyph. This information
is only needed at the end of the test.
@@ -2765,6 +2765,7 @@ def com_google_fonts_test_074(ttFont):
def com_google_fonts_test_075(ttFont):
"""Check for points out of bounds."""
failed = False
+ out_of_bounds = []
for glyphName in ttFont['glyf'].keys():
glyph = ttFont['glyf'][glyphName]
coords = glyph.getCoordinates(ttFont['glyf'])[0]
@@ -2773,16 +2774,18 @@ def com_google_fonts_test_075(ttFont):
y < glyph.yMin or y > glyph.yMax or \
abs(x) > 32766 or abs(y) > 32766:
failed = True
- yield WARN, ("Glyph '{}' coordinates ({},{})"
- " out of bounds."
- " This happens a lot when points are not extremes,"
- " which is usually bad. However, fixing this alert"
- " by adding points on extremes may do more harm"
- " than good, especially with italics,"
+ out_of_bounds.append((glyphName, x, y))
+
+ if failed:
+ yield WARN, ("The following glyphs have coordinates which are"
+ " out of bounds:\n{}\nThis happens a lot when points"
+ " are not extremes, which is usually bad. However,"
+ " fixing this alert by adding points on extremes may"
+ " do more harm than good, especially with italics,"
" calligraphic-script, handwriting, rounded and"
" other fonts. So it is common to"
- " ignore this message.").format(glyphName, x, y)
- if not failed:
+ " ignore this message".format(out_of_bounds))
+ else:
yield PASS, "All glyph paths have coordinates within bounds!"
