From 78f6c2ae7538bbe18764aa1660083ba91f6eb8b2 Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Fri, 9 Oct 2020 11:05:32 +0100 Subject: [PATCH] instancer: add test for partial instance name --- Tests/varLib/instancer_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Tests/varLib/instancer_test.py b/Tests/varLib/instancer_test.py index c6ae14666..d0aa44f3f 100644 --- a/Tests/varLib/instancer_test.py +++ b/Tests/varLib/instancer_test.py @@ -1995,6 +1995,15 @@ def test_updateNameTable_with_multilingual_names(varfont): assert names[(17, 3, 1, 0x405)] == "Negreta Zhuštěné" +def test_updateNametable_partial(varfont): + instancer.updateNameTable(varfont, {"wdth": 79, "wght": (400, 900)}) + names = _get_name_records(varfont) + assert names[(1, 3, 1, 0x409)] == "Test Variable Font Condensed" + assert names[(2, 3, 1, 0x409)] == "Regular" + assert names[(16, 3, 1, 0x409)] == "Test Variable Font" + assert names[(17, 3, 1, 0x409)] == "Condensed" #? maybe Condensed Regular? + + def test_sanityCheckVariableTables(varfont): font = ttLib.TTFont() with pytest.raises(ValueError, match="Missing required table fvar"):