diff --git a/CHANGELOG.md b/CHANGELOG.md index e0349c35aa..a59c8cd880 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ A more detailed list of changes is available in the corresponding milestones for - ... ### Changes to existing checks +### On the Universal profile. + - **[no_debugging_tables]:** merged into unwanted_tables. (issue #4972) + ### On the OpenType Profile - **[opentype/slant_direction]:** SKIP instead of ERROR if a font does not contain 'H' (PR #4969) diff --git a/Lib/fontbakery/checks/no_debugging_tables.py b/Lib/fontbakery/checks/no_debugging_tables.py deleted file mode 100644 index 6e7f3a737d..0000000000 --- a/Lib/fontbakery/checks/no_debugging_tables.py +++ /dev/null @@ -1,25 +0,0 @@ -from fontbakery.prelude import check, Message, WARN - - -@check( - id="no_debugging_tables", - rationale=""" - Tables such as `Debg` are useful in the pre-production stages of font - development, but add unnecessary bloat to a production font and should - be removed before release. - """, - severity=6, - proposal="https://github.com/fonttools/fontbakery/issues/3357", -) -def check_no_debugging_tables(ttFont): - """Ensure fonts do not contain any pre-production tables.""" - - DEBUGGING_TABLES = ["Debg", "FFTM"] - found = [t for t in DEBUGGING_TABLES if t in ttFont] - if found: - tables_list = ", ".join(found) - yield WARN, Message( - "has-debugging-tables", - f"This font file contains the following" - f" pre-production tables: {tables_list}", - ) diff --git a/Lib/fontbakery/checks/unwanted_tables.py b/Lib/fontbakery/checks/unwanted_tables.py index 468201121f..e2dd888d89 100644 --- a/Lib/fontbakery/checks/unwanted_tables.py +++ b/Lib/fontbakery/checks/unwanted_tables.py @@ -38,6 +38,7 @@ def check_unwanted_tables(ttFont): " Although Harfbuzz now has optional AAT support," " new fonts should not be using that." ), + "Debg": "FontTools debugging table", } unwanted_tables_found = [] unwanted_tables_tags = set(UNWANTED_TABLES) diff --git a/Lib/fontbakery/legacy_checkids.py b/Lib/fontbakery/legacy_checkids.py index a6d07eea87..aadd958185 100644 --- a/Lib/fontbakery/legacy_checkids.py +++ b/Lib/fontbakery/legacy_checkids.py @@ -191,7 +191,7 @@ "com.google.fonts/check/name/no_copyright_on_description": "name/no_copyright_on_description", "com.google.fonts/check/name/trailing_spaces": "name/trailing_spaces", "com.google.fonts/check/glyf_nested_components": "nested_components", - "com.google.fonts/check/no_debugging_tables": "no_debugging_tables", + "com.google.fonts/check/no_debugging_tables": "unwanted_tables", "com.fontwerk/check/no_mac_entries": "no_mac_entries", "com.google.fonts/check/cmap/alien_codepoints": "notofonts/cmap/alien_codepoints", "com.google.fonts/check/cmap/unexpected_subtables": "notofonts/cmap/unexpected_subtables", diff --git a/Lib/fontbakery/profiles/adobefonts.py b/Lib/fontbakery/profiles/adobefonts.py index 1a6eb588de..e9f7035b0c 100644 --- a/Lib/fontbakery/profiles/adobefonts.py +++ b/Lib/fontbakery/profiles/adobefonts.py @@ -65,7 +65,6 @@ "name/family_and_style_max_length", "name/italic_names", "nested_components", - "no_debugging_tables", "no_mac_entries", "overlapping_path_segments", "smallcaps_before_ligatures", diff --git a/Lib/fontbakery/profiles/microsoft.py b/Lib/fontbakery/profiles/microsoft.py index 96cb87f20c..5dde52d85e 100644 --- a/Lib/fontbakery/profiles/microsoft.py +++ b/Lib/fontbakery/profiles/microsoft.py @@ -35,7 +35,6 @@ "name/char_restrictions", "name/family_and_style_max_length", "nested_components", - "no_debugging_tables", "no_mac_entries", "overlapping_path_segments", "smallcaps_before_ligatures", diff --git a/Lib/fontbakery/profiles/universal.py b/Lib/fontbakery/profiles/universal.py index fcddae0079..029c0e9f73 100644 --- a/Lib/fontbakery/profiles/universal.py +++ b/Lib/fontbakery/profiles/universal.py @@ -62,7 +62,6 @@ "name/no_copyright_on_description", "name/italic_names", "nested_components", - "no_debugging_tables", "no_mac_entries", "os2_metrics_match_hhea", "ots", diff --git a/tests/test_checks_no_debugging_tables.py b/tests/test_checks_no_debugging_tables.py deleted file mode 100644 index 28022fd5af..0000000000 --- a/tests/test_checks_no_debugging_tables.py +++ /dev/null @@ -1,20 +0,0 @@ -from fontTools.ttLib import TTFont - -from conftest import check_id -from fontbakery.codetesting import ( - TEST_FILE, - assert_PASS, - assert_results_contain, -) -from fontbakery.status import WARN - - -@check_id("no_debugging_tables") -def test_check_no_debugging_tables(check): - """Ensure fonts do not contain any preproduction tables.""" - - ttFont = TTFont(TEST_FILE("overpassmono/OverpassMono-Regular.ttf")) - assert_results_contain(check(ttFont), WARN, "has-debugging-tables") - - del ttFont["FFTM"] - assert_PASS(check(ttFont)) diff --git a/tests/test_checks_unwanted_tables.py b/tests/test_checks_unwanted_tables.py index 438c1cdc6c..ceb3666eb9 100644 --- a/tests/test_checks_unwanted_tables.py +++ b/tests/test_checks_unwanted_tables.py @@ -39,6 +39,9 @@ def test_check_unwanted_tables(check): "TSI3", "TSI5", "prop", # FIXME: Why is this one unwanted? + "Debg", # Tables such as `Debg` are useful in the pre-production stages of + # font development, but add unnecessary bloat to a production font + # and should be removed before release. ] # Our reference Mada Regular font is good here: ttFont = TTFont(TEST_FILE("mada/Mada-Regular.ttf"))