Skip to content

Commit

Permalink
Update supported tables in Adobe Fonts profile (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelsousa authored Nov 13, 2024
2 parents 074aabd + c693ad6 commit ea7cfc7
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 43 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `com.google.fonts/check/family/panose_familytype` and `com.google.fonts/check/family/panose_proportion`: Failures have been downgraded to warnings (https://github.com/fonttools/fontbakery/issues/4192).
- `com.adobe.fonts/check/postscript_name_characters`: Added underscore (`_` U+005F) to the set of characters allowed in PostScript name strings (https://github.com/miguelsousa/openbakery/pull/90).
- Removed the `fontval` profile (https://github.com/miguelsousa/openbakery/pull/141).
- `com.adobe.fonts/check/unsupported_tables`: Added COLR and CPAL tables to SUPPORTED_TABLES (https://github.com/miguelsousa/openbakery/pull/205)

### Fixed

Expand Down
89 changes: 46 additions & 43 deletions Lib/openbakery/profiles/adobefonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,52 @@
"com.google.fonts/check/whitespace_glyphs",
]

SUPPORTED_TABLES = {
"avar",
"BASE",
"CFF ",
"CFF2",
"cmap",
"COLR",
"CPAL",
"cvar",
"cvt ",
"DSIG",
"feat",
"fpgm",
"fvar",
"gasp",
"GDEF",
"glyf",
"GPOS",
"GSUB",
"gvar",
"hdmx",
"head",
"hhea",
"hmtx",
"HVAR",
"kern",
"loca",
"LTSH",
"maxp",
"meta",
"morx",
"MVAR",
"name",
"OS/2",
"PCLT",
"post",
"prep",
"STAT",
"SVG ",
"VDMX",
"vhea",
"vmtx",
"VORG",
"VVAR",
}


@check(
id="com.adobe.fonts/check/family/consistent_upm",
Expand Down Expand Up @@ -421,49 +467,6 @@ def com_adobe_fonts_check_nameid_1_win_english(ttFont, has_name_table):
)
def com_adobe_fonts_check_unsupported_tables(ttFont):
"""Does the font have any unsupported tables?"""
SUPPORTED_TABLES = {
"avar",
"BASE",
"CFF ",
"CFF2",
"cmap",
"cvar",
"cvt ",
"DSIG",
"feat",
"fpgm",
"fvar",
"gasp",
"GDEF",
"glyf",
"GPOS",
"GSUB",
"gvar",
"hdmx",
"head",
"hhea",
"hmtx",
"HVAR",
"kern",
"loca",
"LTSH",
"maxp",
"meta",
"morx",
"MVAR",
"name",
"OS/2",
"PCLT",
"post",
"prep",
"STAT",
"SVG ",
"VDMX",
"vhea",
"vmtx",
"VORG",
"VVAR",
}
font_tables = set(ttFont.keys())
font_tables.discard("GlyphOrder") # pseudo-table created by FontTools
unsupported_tables = sorted(font_tables - SUPPORTED_TABLES)
Expand Down
4 changes: 4 additions & 0 deletions tests/profiles/adobefonts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ def test_check_unsupported_tables():
msg = assert_PASS(check(ttFont))
assert msg == "No unsupported tables were found."

ttFont = TTFont(TEST_FILE("color_fonts/noto-glyf_colr_1.ttf"))
msg = assert_PASS(check(ttFont))
assert msg == "No unsupported tables were found."

ttFont = TTFont(TEST_FILE("hinting/Roboto-VF.ttf"))
msg = assert_results_contain(check(ttFont), FAIL, "unsupported-tables")
assert "TSI0" in msg
Expand Down

0 comments on commit ea7cfc7

Please sign in to comment.