From 58cbf7b814e62772493dce9c069cc3c6959e56fe Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Tue, 7 Jan 2020 12:57:11 +0000 Subject: [PATCH] otTables_test: get XML dumps for expected MarkBasePos split subtables This tests will fail because of this bug: https://github.com/googlefonts/noto-source/issues/145 The mark records' Class values of the second subtable should be updated to match the new class count (the two split subtable contain half of the original mark classes). Otherwise the base records would implicitly reference the wrong or non-existent mark classes... The fix is in the following commit. --- Tests/ttLib/tables/otTables_test.py | 93 +++++++++++++++++++++++++---- 1 file changed, 80 insertions(+), 13 deletions(-) diff --git a/Tests/ttLib/tables/otTables_test.py b/Tests/ttLib/tables/otTables_test.py index 4afe2dbff..bd4daeb9d 100644 --- a/Tests/ttLib/tables/otTables_test.py +++ b/Tests/ttLib/tables/otTables_test.py @@ -605,20 +605,87 @@ def test_splitMarkBasePos(): ok = otTables.splitMarkBasePos(oldSubTable, newSubTable, overflowRecord=None) assert ok - assert oldSubTable.Format == newSubTable.Format - assert oldSubTable.MarkCoverage.glyphs == [ - "acutecomb", "gravecomb" + + assert getXML(oldSubTable.toXML) == [ + '', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + '', + ] + + assert getXML(newSubTable.toXML) == [ + '', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + '', ] - assert newSubTable.MarkCoverage.glyphs == ["cedillacomb"] - assert newSubTable.MarkCoverage.Format == 1 - assert oldSubTable.BaseCoverage.glyphs == newSubTable.BaseCoverage.glyphs - assert newSubTable.BaseCoverage.Format == 1 - assert oldSubTable.ClassCount == newSubTable.ClassCount == 1 - assert oldSubTable.MarkArray.MarkCount == 2 - assert newSubTable.MarkArray.MarkCount == 1 - assert oldSubTable.BaseArray.BaseCount == newSubTable.BaseArray.BaseCount - assert newSubTable.BaseArray.BaseRecord[0].BaseAnchor[0] is None - assert newSubTable.BaseArray.BaseRecord[1].BaseAnchor[0] == buildAnchor(300, 0) if __name__ == "__main__":