From: Marc Foley Date: Mon, 5 Feb 2024 15:14:37 +0000 (+0000) Subject: _fvar_dflts: move priority of opsz axis X-Git-Tag: v0.4.6^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9711e33ec7be9b85e8a52dabe1b183d5b691176;p=thirdparty%2Fgoogle%2Ffonts.git _fvar_dflts: move priority of opsz axis --- diff --git a/Lib/axisregistry/__init__.py b/Lib/axisregistry/__init__.py index 09f8a30240..9b4bdb35c8 100644 --- a/Lib/axisregistry/__init__.py +++ b/Lib/axisregistry/__init__.py @@ -150,14 +150,14 @@ def _fvar_dflts(ttFont): res = OrderedDict() for a in ttFont["fvar"].axes: fallback = axis_registry.fallback_for_value(a.axisTag, a.defaultValue) - if fallback: + if a.axisTag == "opsz": + name = f"{int(a.defaultValue)}pt" + elided = True + elif fallback: name = fallback.name elided = fallback.value == axis_registry[ a.axisTag ].default_value and name not in ["Regular", "Italic", "14pt"] - elif a.axisTag == "opsz": - name = f"{int(a.defaultValue)}pt" - elided = False else: name = None elided = True # since we can't find a name for it, keep it elided diff --git a/tests/test_names.py b/tests/test_names.py index 32f2fbf932..a4e3b74e3c 100644 --- a/tests/test_names.py +++ b/tests/test_names.py @@ -303,13 +303,13 @@ def _test_names(ttFont, expected): None, [], { - (1, 3, 1, 0x409): "Playfair 5pt SemiExpanded Light", + (1, 3, 1, 0x409): "Playfair SemiExpanded Light", (2, 3, 1, 0x409): "Regular", - (3, 3, 1, 0x409): "2.000;FTH;Playfair-5ptSemiExpandedLight", - (4, 3, 1, 0x409): "Playfair 5pt SemiExpanded Light", - (6, 3, 1, 0x409): "Playfair-5ptSemiExpandedLight", + (3, 3, 1, 0x409): "2.000;FTH;Playfair-SemiExpandedLight", + (4, 3, 1, 0x409): "Playfair SemiExpanded Light", + (6, 3, 1, 0x409): "Playfair-SemiExpandedLight", (16, 3, 1, 0x409): "Playfair", - (17, 3, 1, 0x409): "5pt SemiExpanded Light", + (17, 3, 1, 0x409): "SemiExpanded Light", }, ), ],