From 80f6d80493b68a721bc55bc206a001af0aaeba73 Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Mon, 10 Oct 2022 11:55:47 +0100 Subject: [PATCH] build_stat: do not rm fvar axis name records --- Lib/axisregistry/__init__.py | 4 +++- .../data/OpenSans-Italic[wdth,wght]_STAT.ttx | 24 +++++++++---------- .../OpenSansCondensed-Italic[wght]_STAT.ttx | 22 ++++++++--------- tests/data/OpenSansCondensed[wght]_STAT.ttx | 2 +- tests/data/OpenSans[wdth,wght]_STAT.ttx | 20 ++++++++-------- tests/data/Wonky[wdth,wght]_STAT.ttx | 12 +++++----- 6 files changed, 43 insertions(+), 41 deletions(-) diff --git a/Lib/axisregistry/__init__.py b/Lib/axisregistry/__init__.py index f90a6b106..162240c88 100644 --- a/Lib/axisregistry/__init__.py +++ b/Lib/axisregistry/__init__.py @@ -176,7 +176,9 @@ def build_stat(ttFont, sibling_ttFonts=[]): fvar = ttFont["fvar"] # rm old STAT table and associated name table records - fvar_nameids = set(i.subfamilyNameID for i in fvar.instances) + fvar_instance_nameids = set(i.subfamilyNameID for i in fvar.instances) + fvar_axis_nameids = set(a.axisNameID for a in fvar.axes) + fvar_nameids = fvar_axis_nameids | fvar_instance_nameids if "STAT" in ttFont: stat = ttFont["STAT"] if stat.table.AxisValueCount > 0: diff --git a/tests/data/OpenSans-Italic[wdth,wght]_STAT.ttx b/tests/data/OpenSans-Italic[wdth,wght]_STAT.ttx index 697c5fd64..6b82b0fcf 100644 --- a/tests/data/OpenSans-Italic[wdth,wght]_STAT.ttx +++ b/tests/data/OpenSans-Italic[wdth,wght]_STAT.ttx @@ -4,12 +4,12 @@ - + - + @@ -28,56 +28,56 @@ - + - + - + - + - + - + - + - + - + @@ -89,7 +89,7 @@ - + diff --git a/tests/data/OpenSansCondensed-Italic[wght]_STAT.ttx b/tests/data/OpenSansCondensed-Italic[wght]_STAT.ttx index b06952991..bd39b5cc8 100644 --- a/tests/data/OpenSansCondensed-Italic[wght]_STAT.ttx +++ b/tests/data/OpenSansCondensed-Italic[wght]_STAT.ttx @@ -4,7 +4,7 @@ - + @@ -33,50 +33,50 @@ - + - + - + - + - + - + - + - + @@ -94,14 +94,14 @@ - + - + diff --git a/tests/data/OpenSansCondensed[wght]_STAT.ttx b/tests/data/OpenSansCondensed[wght]_STAT.ttx index ff14aa6a7..503f3a4d3 100644 --- a/tests/data/OpenSansCondensed[wght]_STAT.ttx +++ b/tests/data/OpenSansCondensed[wght]_STAT.ttx @@ -4,7 +4,7 @@ - + diff --git a/tests/data/OpenSans[wdth,wght]_STAT.ttx b/tests/data/OpenSans[wdth,wght]_STAT.ttx index 64edce6cf..7ab8b63e4 100644 --- a/tests/data/OpenSans[wdth,wght]_STAT.ttx +++ b/tests/data/OpenSans[wdth,wght]_STAT.ttx @@ -4,22 +4,22 @@ - + - + - + - + @@ -41,7 +41,7 @@ - + @@ -65,32 +65,32 @@ - + - + - + - + - + diff --git a/tests/data/Wonky[wdth,wght]_STAT.ttx b/tests/data/Wonky[wdth,wght]_STAT.ttx index b35d26756..65605ac9e 100644 --- a/tests/data/Wonky[wdth,wght]_STAT.ttx +++ b/tests/data/Wonky[wdth,wght]_STAT.ttx @@ -4,12 +4,12 @@ - + - + @@ -31,7 +31,7 @@ - + @@ -55,19 +55,19 @@ - + - + - +