Skip to content

Commit 9a09133

Browse files
committed
pytest: test/061 + emit INFO for fonts lacking EPAR table
(issue #1413)
1 parent 591bb1e commit 9a09133

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

Lib/fontbakery/specifications/googlefonts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2310,7 +2310,7 @@ def check_no_glyph_is_incorrectly_named(ttFont):
23102310
def check_EPAR_table_is_present(ttFont):
23112311
"""EPAR table present in font?"""
23122312
if "EPAR" not in ttFont:
2313-
yield PASS, ("EPAR table not present in font."
2313+
yield INFO, ("EPAR table not present in font."
23142314
" To learn more see"
23152315
" https://github.com/googlefonts/"
23162316
"fontbakery/issues/818")

Lib/fontbakery/specifications/googlefonts_test.py

+24
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,30 @@ def test_id_057():
10431043
status, message = list(check_name_table_entries_do_not_contain_linebreaks(ttFont))[-1]
10441044
assert status == FAIL
10451045

1046+
# TODO: test_id_058
1047+
# TODO: test_id_059
1048+
# TODO: test_id_060
1049+
1050+
def test_id_061():
1051+
""" EPAR table present in font ? """
1052+
from fontbakery.specifications.googlefonts import \
1053+
check_EPAR_table_is_present
1054+
1055+
# Our reference Mada Regular lacks an EPAR table:
1056+
ttFont = TTFont("data/test/mada/Mada-Regular.ttf")
1057+
1058+
# So it must emit an INFO message inviting the designers
1059+
# to learn more about it:
1060+
print ("Test INFO with a font lacking an EPAR table...")
1061+
status, message = list(check_EPAR_table_is_present(ttFont))[-1]
1062+
assert status == INFO
1063+
1064+
print ("Test PASS with a good font...")
1065+
# add a fake EPAR table to validate the PASS code-path:
1066+
ttFont["EPAR"] = "foo"
1067+
status, message = list(check_EPAR_table_is_present(ttFont))[-1]
1068+
assert status == PASS
1069+
10461070

10471071
def test_id_153(montserrat_ttFonts):
10481072
"""Check glyphs contain the recommended contour count"""

0 commit comments

Comments
 (0)