Skip to content

Commit

Permalink
Merge pull request #1493 from felipesanches/issue_1436
Browse files Browse the repository at this point in the history
Add warning message for special case in name table check
  • Loading branch information
felipesanches authored Aug 8, 2017
2 parents b459bc2 + 3622f0d commit 782717b
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions Lib/fontbakery/specifications/googlefonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,15 +664,30 @@ def get_only_weight(value):
PLATID_STR[plat],
plat)
elif string != expected_value:
failed = True
yield FAIL, ("[{}({}):{}({})] entry:"
" expected '{}'"
" but got '{}'").format(NAMEID_STR[nameid],
nameid,
PLATID_STR[plat],
plat,
expected_value,
unidecode(string))

# special case for FULL_FONT_NAME:
# see https://github.com/googlefonts/fontbakery/issues/1436
if name.nameID == NAMEID_FULL_FONT_NAME \
and style == "Regular" \
and string == fname_with_spaces:
yield WARN, ("[{}({}):{}({})] entry:"
" Got '{}' which lacks 'Regular',"
" but is probably OK"
" in this case.").format(NAMEID_STR[nameid],
nameid,
PLATID_STR[plat],
plat,
unidecode(string))
else:
failed = True
yield FAIL, ("[{}({}):{}({})] entry:"
" expected '{}'"
" but got '{}'").format(NAMEID_STR[nameid],
nameid,
PLATID_STR[plat],
plat,
expected_value,
unidecode(string))
if not failed:
yield PASS, ("Main entries in the name table"
" conform to expected format.")
Expand Down

0 comments on commit 782717b

Please sign in to comment.