[feaLib] Make unsupported "subtable" a warning
AFDKO’s makeotf warns and ignores the statement, so do the same. I’m abusing FeatureLibError() as a lazy way to keep reporting the location.
This commit is contained in:
parent
10cad7be3a
commit
7d03e93e67
@ -1179,10 +1179,10 @@ class LookupBuilder(object):
|
||||
return subtables
|
||||
|
||||
def add_subtable_break(self, location):
|
||||
raise FeatureLibError(
|
||||
log.warning(FeatureLibError(
|
||||
'unsupported "subtable" statement for lookup type',
|
||||
location
|
||||
)
|
||||
))
|
||||
|
||||
|
||||
class AlternateSubstBuilder(LookupBuilder):
|
||||
|
@ -514,16 +514,17 @@ class BuilderTest(unittest.TestCase):
|
||||
assert "GSUB" in font
|
||||
|
||||
def test_unsupported_subtable_break(self):
|
||||
self.assertRaisesRegex(
|
||||
FeatureLibError,
|
||||
'unsupported "subtable" statement for lookup type',
|
||||
self.build,
|
||||
"feature test {"
|
||||
" pos a 10;"
|
||||
" subtable;"
|
||||
" pos b 10;"
|
||||
"} test;"
|
||||
)
|
||||
with self.assertLogs(level='WARNING') as logs:
|
||||
self.build(
|
||||
"feature test {"
|
||||
" pos a 10;"
|
||||
" subtable;"
|
||||
" pos b 10;"
|
||||
"} test;"
|
||||
)
|
||||
self.assertEqual(logs.output,
|
||||
['WARNING:fontTools.feaLib.builder:<features>:1:32: '
|
||||
'unsupported "subtable" statement for lookup type'])
|
||||
|
||||
def test_skip_featureNames_if_no_name_table(self):
|
||||
features = (
|
||||
|
Loading…
x
Reference in New Issue
Block a user