Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to disable ufo2ft variable FEA, restore varLib merging of OTL tables #1064

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Lib/fontmake/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
)
Expand Down
8 changes: 8 additions & 0 deletions Lib/fontmake/font_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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(
Expand All @@ -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():
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -1293,6 +1298,7 @@ def _run_from_designspace_interpolatable(
designspace,
outputs,
variable_fonts: str = ".*",
variable_features=True,
output_path=None,
output_dir=None,
**kwargs,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fonttools[repacker,ufo,unicode,lxml]==4.47.2; platform_python_implementation == 'CPython'
fonttools[repacker,ufo,unicode]==4.47.2; platform_python_implementation != 'CPython'
glyphsLib==6.6.1
ufo2ft==2.33.4
ufo2ft==3.0.0a1
fontMath==0.9.3
booleanOperations==0.9.0
ufoLib2==0.16.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"fontMath": ">=0.9.3",
"fonttools": ">=4.47.2",
"glyphsLib": ">=6.6.1",
"ufo2ft": ">=2.33.4",
"ufo2ft": ">=3.0.0a1",
"ufoLib2": ">=0.16.0",
}

Expand Down
Loading