Skip to content

Commit

Permalink
"Critical" failures are now FATAL-level...
Browse files Browse the repository at this point in the history
When glyphs needed to compute xAvgCharWidth are missing, it is considered critical, so it is now results in a FATAL-level result.

(PR #4570)
  • Loading branch information
simoncozens authored and felipesanches committed Mar 5, 2024
1 parent 85c7f6a commit 038d11e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ A more detailed list of changes is available in the corresponding milestones for
- **[com.google.fonts/check/varfont/family_axis_ranges]:** Updated the check to skip fonts without fvar tables. (issue #4554)
- **[com.google.fonts/check/mac_style]:** Skip if font style can not be determined. (issue #4349)
- **[com.google.fonts/check/family/panose_familytype]:** Add rationale and improve message when there are inconsistencies. (PR #4570)
- **[com.google.fonts/check/xavgcharwidth]:** When glyphs needed to compute xAvgCharWidth are missing, it is considered critical, so it is now results in a FATAL-level result. (PR #4570)


## 0.12.0a2 (2024-Feb-21)
Expand Down
4 changes: 2 additions & 2 deletions Lib/fontbakery/checks/opentype/os2.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def com_google_fonts_check_xavgcharwidth(ttFont):
if ttFont["OS/2"].version >= 3:
calculation_rule = "the average of the widths of all glyphs in the font"
if not ttFont["hmtx"].metrics: # May contain just '.notdef', which is valid.
yield FAIL, Message(
yield FATAL, Message(
"missing-glyphs",
"CRITICAL: Found no glyph width data in the hmtx table!",
"Found no glyph width data in the hmtx table!",
)
return

Expand Down
4 changes: 2 additions & 2 deletions tests/checks/opentype/os2_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from fontTools.ttLib import TTFont
import fontTools.subset

from fontbakery.status import INFO, WARN, FAIL, PASS
from fontbakery.status import INFO, WARN, FAIL, PASS, FATAL
from fontbakery.codetesting import (
assert_PASS,
assert_SKIP,
Expand Down Expand Up @@ -173,7 +173,7 @@ def test_check_xavgcharwidth():
]
)
subsetter.subset(test_font)
assert_results_contain(check(test_font), FAIL, "missing-glyphs")
assert_results_contain(check(test_font), FATAL, "missing-glyphs")


def test_check_fsselection_matches_macstyle():
Expand Down

0 comments on commit 038d11e

Please sign in to comment.