Add test for Regular fallback

This commit is contained in:
Marc Foley 2021-02-22 11:31:48 +00:00 committed by Cosimo Lupo
parent d1a8e1ee76
commit a7913ef50e
No known key found for this signature in database
GPG Key ID: 179A8F0895A02F4F

View File

@ -305,3 +305,14 @@ def test_updateNameTable_elided_axisValues(varfont):
# the subFamilyName set so it conforms to the RIBBI model.
expected = {(2, 3, 1, 0x409): "Regular", (17, 3, 1, 0x409): "Black"}
_test_name_records(varfont, expected, isNonRIBBI=True)
def test_updateNameTable_existing_subfamily_name_is_not_regular(varfont):
# Check the subFamily name will be set to Regular when we update a name
# table to a non-RIBBI style and the current subFamily name is a RIBBI
# style which isn't Regular.
varfont["name"].setName("Bold", 2, 3, 1, 0x409) # subFamily Regular --> Bold
instancer.names.updateNameTable(varfont, {"wght": 100})
expected = {(2, 3, 1, 0x409): "Regular", (17, 3, 1, 0x409): "Thin"}
_test_name_records(varfont, expected, isNonRIBBI=True)