From: Simon Cozens Date: Mon, 19 Feb 2024 12:08:39 +0000 (+0000) Subject: Test for aggressive renames X-Git-Tag: v0.4.9^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d69541d1e76956ea202a401c5c60e25365a0b0f;p=thirdparty%2Fgoogle%2Ffonts.git Test for aggressive renames --- diff --git a/tests/test_names.py b/tests/test_names.py index 32f2fbf932..f48d8fb129 100644 --- a/tests/test_names.py +++ b/tests/test_names.py @@ -321,6 +321,37 @@ def test_name_table(fp, family_name, style_name, siblings, expected): _test_names(font, expected) +def test_name_table_aggression(): + font = TTFont(mavenpro_fp) + build_name_table(font, "Raven Am", "Regular", aggressive=True) + _test_names( + font, + { + ( + 0, + 3, + 1, + 0x409, + ): 'Copyright 2011 The Raven Am Project Authors (http://www.vissol.co.uk/mavenpro/), with Reserved Font Name "Raven Am".', + (4, 3, 1, 0x409): "Raven Am Regular", + }, + ) + font = TTFont(mavenpro_fp) + build_name_table(font, "Raven Am", "Regular", aggressive=False) + _test_names( + font, + { + ( + 0, + 3, + 1, + 0x409, + ): 'Copyright 2011 The Maven Pro Project Authors (http://www.vissol.co.uk/mavenpro/), with Reserved Font Name "Maven Pro".', + (4, 3, 1, 0x409): "Raven Am Regular", + }, + ) + + @pytest.mark.parametrize( "font_fp, dflt_coords, expected", [