diff --git a/Lib/fontmake/__main__.py b/Lib/fontmake/__main__.py index fa32f273..0ce9dc13 100644 --- a/Lib/fontmake/__main__.py +++ b/Lib/fontmake/__main__.py @@ -583,6 +583,16 @@ def main(args=None): "features (kern, mark, mkmk, etc.)." ), ) + layoutGroup.add_argument( + "--no-variable-features", + action="store_false", + dest="variable_features", + help=( + "Disable generation of variable FEA in ufo2ft when compiling VFs; " + "instead build separate OT layout tables for each master and merge " + "them with varLib." + ), + ) feaCompilerGroup = layoutGroup.add_mutually_exclusive_group(required=False) feaCompilerGroup.add_argument( @@ -680,7 +690,7 @@ def main(args=None): exclude_args( parser, args, - ["variable_fonts", "optimize_gvar"], + ["variable_fonts", "optimize_gvar", "variable_features"], "static output", positive=False, ) diff --git a/Lib/fontmake/font_project.py b/Lib/fontmake/font_project.py index 7936da6d..9db5baef 100644 --- a/Lib/fontmake/font_project.py +++ b/Lib/fontmake/font_project.py @@ -398,6 +398,7 @@ def build_variable_fonts( filters=None, auto_use_my_metrics=True, drop_implied_oncurves=False, + variable_features=True, **kwargs, ): """Build OpenType variable fonts from masters in a designspace.""" @@ -464,6 +465,7 @@ def build_variable_fonts( variableFontNames=list(vf_name_to_output_path), autoUseMyMetrics=auto_use_my_metrics, dropImpliedOnCurves=drop_implied_oncurves, + variableFeatures=variable_features, ) else: fonts = ufo2ft.compileVariableCFF2s( @@ -477,6 +479,7 @@ def build_variable_fonts( filters=filters, inplace=True, variableFontNames=list(vf_name_to_output_path), + variableFeatures=variable_features, ) for name, font in fonts.items(): @@ -1086,6 +1089,7 @@ def run_from_designspace( interpolate_binary_layout=False, round_instances=False, feature_writers=None, + variable_features=True, filters=None, expand_features_to_instances=False, check_compatibility=None, @@ -1204,6 +1208,7 @@ def run_from_designspace( variable_fonts=variable_fonts, feature_writers=feature_writers, filters=filters, + variable_features=variable_features, **kwargs, ) except FontmakeError as e: @@ -1293,6 +1298,7 @@ def _run_from_designspace_interpolatable( designspace, outputs, variable_fonts: str = ".*", + variable_features=True, output_path=None, output_dir=None, **kwargs, @@ -1303,6 +1309,7 @@ def _run_from_designspace_interpolatable( self.build_variable_fonts( designspace, variable_fonts=variable_fonts, + variable_features=variable_features, output_path=output_path, output_dir=output_dir, **kwargs, @@ -1316,6 +1323,7 @@ def _run_from_designspace_interpolatable( self.build_variable_fonts( designspace, variable_fonts=variable_fonts, + variable_features=variable_features, output_path=output_path, output_dir=output_dir, ttf=False,