From 3c98f78531a559d5d8c89baf940cfa38870a6b04 Mon Sep 17 00:00:00 2001 From: Stephen Nixon Date: Tue, 11 Jun 2024 11:41:46 -0400 Subject: [PATCH 1/4] Add '--expand-features-to-instances' arg to fontmake UFO generation --- Lib/gftools/builder/operations/instantiateUfo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/gftools/builder/operations/instantiateUfo.py b/Lib/gftools/builder/operations/instantiateUfo.py index 94986bd40..22b637d08 100644 --- a/Lib/gftools/builder/operations/instantiateUfo.py +++ b/Lib/gftools/builder/operations/instantiateUfo.py @@ -59,6 +59,7 @@ def targets(self): def variables(self): vars = super().variables vars["args"] += " --ufo-structure=json " + vars["args"] += " --expand-features-to-instances " if self.first_source.is_glyphs: vars["args"] += f"--instance-dir {escape_path(str(self.instance_dir))}" else: From b56edadc2c9b0eb05d1d7c78fbed16f42fb097de Mon Sep 17 00:00:00 2001 From: Stephen Nixon Date: Thu, 3 Oct 2024 16:49:07 -0400 Subject: [PATCH 2/4] remove --expand-features-to-instances from static build args, as this blocks the build --- Lib/gftools/builder/recipeproviders/googlefonts.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Lib/gftools/builder/recipeproviders/googlefonts.py b/Lib/gftools/builder/recipeproviders/googlefonts.py index 4ab8a4961..152bfdb06 100644 --- a/Lib/gftools/builder/recipeproviders/googlefonts.py +++ b/Lib/gftools/builder/recipeproviders/googlefonts.py @@ -193,8 +193,6 @@ def fontmake_args(self, source, variable=False): args += " --keep-direction" if self.config.get("removeOutlineOverlaps") is False: args += " --keep-overlaps" - if self.config.get("expandFeaturesToInstances"): - args += " --expand-features-to-instances" if self.config.get("extraFontmakeArgs") is not None: args += " " + str(self.config["extraFontmakeArgs"]) if variable: From 532a8b270253b08424e9e282ca1a699f04f4753d Mon Sep 17 00:00:00 2001 From: Stephen Nixon Date: Thu, 3 Oct 2024 17:06:59 -0400 Subject: [PATCH 3/4] Pass bool of expandFeaturesToInstances from config to instantiateUfo step; make True by default --- Lib/gftools/builder/operations/instantiateUfo.py | 3 ++- Lib/gftools/builder/recipeproviders/googlefonts.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/gftools/builder/operations/instantiateUfo.py b/Lib/gftools/builder/operations/instantiateUfo.py index 22b637d08..11e00fe1f 100644 --- a/Lib/gftools/builder/operations/instantiateUfo.py +++ b/Lib/gftools/builder/operations/instantiateUfo.py @@ -59,7 +59,8 @@ def targets(self): def variables(self): vars = super().variables vars["args"] += " --ufo-structure=json " - vars["args"] += " --expand-features-to-instances " + if self.original["expandFeaturesToInstances"]: + vars["args"] += " --expand-features-to-instances " if self.first_source.is_glyphs: vars["args"] += f"--instance-dir {escape_path(str(self.instance_dir))}" else: diff --git a/Lib/gftools/builder/recipeproviders/googlefonts.py b/Lib/gftools/builder/recipeproviders/googlefonts.py index 152bfdb06..30999b510 100644 --- a/Lib/gftools/builder/recipeproviders/googlefonts.py +++ b/Lib/gftools/builder/recipeproviders/googlefonts.py @@ -57,6 +57,7 @@ "checkCompatibility": True, "overlaps": "booleanOperations", "splitItalic": True, + "expandFeaturesToInstances": True } @@ -338,6 +339,7 @@ def build_a_static(self, source: File, instance: InstanceDescriptor, output): "operation": "instantiateUfo", "instance_name": instancename, "glyphData": self.config.get("glyphData"), + "expandFeaturesToInstances": self.config.get("expandFeaturesToInstances"), } ) steps += ( From cc8617e1a55eeaeb25a0e8074abe67c0657744c3 Mon Sep 17 00:00:00 2001 From: arrowtype Date: Fri, 4 Oct 2024 14:59:27 -0400 Subject: [PATCH 4/4] format document --- Lib/gftools/builder/recipeproviders/googlefonts.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/gftools/builder/recipeproviders/googlefonts.py b/Lib/gftools/builder/recipeproviders/googlefonts.py index 30999b510..64f48869d 100644 --- a/Lib/gftools/builder/recipeproviders/googlefonts.py +++ b/Lib/gftools/builder/recipeproviders/googlefonts.py @@ -57,7 +57,7 @@ "checkCompatibility": True, "overlaps": "booleanOperations", "splitItalic": True, - "expandFeaturesToInstances": True + "expandFeaturesToInstances": True, } @@ -339,7 +339,9 @@ def build_a_static(self, source: File, instance: InstanceDescriptor, output): "operation": "instantiateUfo", "instance_name": instancename, "glyphData": self.config.get("glyphData"), - "expandFeaturesToInstances": self.config.get("expandFeaturesToInstances"), + "expandFeaturesToInstances": self.config.get( + "expandFeaturesToInstances" + ), } ) steps += (