name = fallback.name
elided = fallback.value == axis_registry[
a.axisTag
- ].default_value and name not in ["Regular", "Italic"]
+ ].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
opensans_cond_roman_fp = os.path.join(DATA_DIR, "OpenSansCondensed[wght].ttf")
opensans_cond_italic_fp = os.path.join(DATA_DIR, "OpenSansCondensed-Italic[wght].ttf")
wonky_fp = os.path.join(DATA_DIR, "Wonky[wdth,wght].ttf")
+playfair_fp = os.path.join(DATA_DIR, "Playfair[opsz,wdth,wght].ttf")
@pytest.fixture
(17, 3, 1, 0x409): None,
},
),
+ # Test opsz particle is kept
+ (
+ playfair_fp,
+ "Playfair",
+ None,
+ [],
+ {
+ (1, 3, 1, 0x409): "Playfair 5pt 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",
+ (16, 3, 1, 0x409): "Playfair",
+ (17, 3, 1, 0x409): "5pt SemiExpanded Light",
+ }
+ )
],
)
def test_name_table(fp, family_name, style_name, siblings, expected):