]> git.ipfire.org Git - thirdparty/google/fonts.git/commitdiff
_fvar_dflts: move priority of opsz axis
authorMarc Foley <m.foley.88@gmail.com>
Mon, 5 Feb 2024 15:14:37 +0000 (15:14 +0000)
committerMarc Foley <m.foley.88@gmail.com>
Mon, 5 Feb 2024 15:14:37 +0000 (15:14 +0000)
Lib/axisregistry/__init__.py
tests/test_names.py

index 09f8a3024078fa1ca1907a411c729aebc254a99d..9b4bdb35c85c2c399a6309ddc730d1eed7913c02 100644 (file)
@@ -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
index 32f2fbf932b78382a2d95d1204c2808e97be045d..a4e3b74e3c82fa1c621631e52f9c6fdbc5750c52 100644 (file)
@@ -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",
             },
         ),
     ],