[feaLib] assert all requested tables are supported
better than just warn
This commit is contained in:
parent
b2da85cffd
commit
803530b281
@ -100,11 +100,7 @@ class Builder(object):
|
|||||||
else:
|
else:
|
||||||
tables = frozenset(tables)
|
tables = frozenset(tables)
|
||||||
unsupported = tables - self.supportedTables
|
unsupported = tables - self.supportedTables
|
||||||
if unsupported:
|
assert not unsupported, unsupported
|
||||||
log.warning(
|
|
||||||
"skipped unsupported table%s: %s" % (
|
|
||||||
"s" if len(unsupported) > 1 else "",
|
|
||||||
", ".join(sorted(repr(tag) for tag in unsupported))))
|
|
||||||
if "GSUB" in tables:
|
if "GSUB" in tables:
|
||||||
self.build_feature_aalt_()
|
self.build_feature_aalt_()
|
||||||
if "head" in tables:
|
if "head" in tables:
|
||||||
|
@ -492,10 +492,8 @@ class BuilderTest(unittest.TestCase):
|
|||||||
font2 = self.build(features, tables=set())
|
font2 = self.build(features, tables=set())
|
||||||
assert "GSUB" not in font2
|
assert "GSUB" not in font2
|
||||||
|
|
||||||
logger = logging.getLogger("fontTools.feaLib.builder")
|
def test_build_unsupported_tables(self):
|
||||||
with CapturingLogHandler(logger, "WARNING") as captor:
|
self.assertRaises(AssertionError, self.build, "", tables={"FOO"})
|
||||||
font = self.build(features, tables=["FOOO", "BAAR"])
|
|
||||||
captor.assertRegex("skipped unsupported tables: 'BAAR', 'FOOO'")
|
|
||||||
|
|
||||||
|
|
||||||
def generate_feature_file_test(name):
|
def generate_feature_file_test(name):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user