Skip to content

Commit

Permalink
pytest: test/061 + emit INFO for fonts lacking EPAR table
Browse files Browse the repository at this point in the history
(issue #1413)
  • Loading branch information
felipesanches committed Aug 2, 2017
1 parent 591bb1e commit 9a09133
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/fontbakery/specifications/googlefonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,7 @@ def check_no_glyph_is_incorrectly_named(ttFont):
def check_EPAR_table_is_present(ttFont):
"""EPAR table present in font?"""
if "EPAR" not in ttFont:
yield PASS, ("EPAR table not present in font."
yield INFO, ("EPAR table not present in font."
" To learn more see"
" https://github.com/googlefonts/"
"fontbakery/issues/818")
Expand Down
24 changes: 24 additions & 0 deletions Lib/fontbakery/specifications/googlefonts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,30 @@ def test_id_057():
status, message = list(check_name_table_entries_do_not_contain_linebreaks(ttFont))[-1]
assert status == FAIL

# TODO: test_id_058
# TODO: test_id_059
# TODO: test_id_060

def test_id_061():
""" EPAR table present in font ? """
from fontbakery.specifications.googlefonts import \
check_EPAR_table_is_present

# Our reference Mada Regular lacks an EPAR table:
ttFont = TTFont("data/test/mada/Mada-Regular.ttf")

# So it must emit an INFO message inviting the designers
# to learn more about it:
print ("Test INFO with a font lacking an EPAR table...")
status, message = list(check_EPAR_table_is_present(ttFont))[-1]
assert status == INFO

print ("Test PASS with a good font...")
# add a fake EPAR table to validate the PASS code-path:
ttFont["EPAR"] = "foo"
status, message = list(check_EPAR_table_is_present(ttFont))[-1]
assert status == PASS


def test_id_153(montserrat_ttFonts):
"""Check glyphs contain the recommended contour count"""
Expand Down

0 comments on commit 9a09133

Please sign in to comment.