[feaLib] Treat vkrn, vpal, vhal, valt as vertical features
Resolves https://github.com/behdad/fonttools/issues/449
This commit is contained in:
parent
b7a7577750
commit
adbf7ec4b1
@ -652,7 +652,7 @@ class Parser(object):
|
||||
assert self.cur_token_ == "feature"
|
||||
location = self.cur_token_location_
|
||||
tag = self.expect_tag_()
|
||||
vertical = (tag == "vkrn")
|
||||
vertical = (tag in {"vkrn", "vpal", "vhal", "valt"})
|
||||
|
||||
use_extension = False
|
||||
if self.next_token_ == "useExtension":
|
||||
|
@ -908,6 +908,15 @@ class ParserTest(unittest.TestCase):
|
||||
self.assertIsNone(value.xAdvDevice)
|
||||
self.assertIsNone(value.yAdvDevice)
|
||||
|
||||
def test_valuerecord_format_a_vertical_contexts_(self):
|
||||
for tag in "vkrn vpal vhal valt".split():
|
||||
doc = self.parse(
|
||||
"feature %s {valueRecordDef 77 foo;} %s;" % (tag, tag))
|
||||
value = doc.statements[0].statements[0].value
|
||||
if value.yAdvance != 77:
|
||||
self.fail(msg="feature %s should be a vertical context "
|
||||
"for ValueRecord format A" % tag)
|
||||
|
||||
def test_valuerecord_format_b(self):
|
||||
doc = self.parse("feature liga {valueRecordDef <1 2 3 4> foo;} liga;")
|
||||
value = doc.statements[0].statements[0].value
|
||||
|
Loading…
x
Reference in New Issue
Block a user