Skip to content

Commit

Permalink
Merge pull request #664 from moyogo/mutatormath
Browse files Browse the repository at this point in the history
Add option to interpolate with MutatorMath (for extrapolation, anisotropic locations)
  • Loading branch information
m4rc1e authored Mar 6, 2023
2 parents 6af0296 + ec3c66d commit 8671c4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Lib/gftools/builder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
* ``removeOutlineOverlaps``: Remove overlaps when compiling fonts. Defaults to fontmake's default.
* ``interpolate``: Enable fontmake --interpolate flag. Defaults to ``false``.
* ``checkCompatibility``: Enable fontmake Multiple Master compatibility checking. Defaults to ``true``.
* ``useMutatorMath``: Use MutatorMath to generate instances (supports extrapolation and anisotropic locations). Defaults to ``false``.
"""

from fontmake.font_project import FontProject
Expand Down Expand Up @@ -314,6 +315,8 @@ def fill_config_defaults(self):
self.config["decomposeTransformedComponents"] = True
if "interpolate" not in self.config:
self.config["interpolate"] = False
if "useMutatorMath" not in self.config:
self.config["useMutatorMath"] = False
if "checkCompatibility" not in self.config:
self.config["checkCompatibility"] = True

Expand Down Expand Up @@ -508,6 +511,8 @@ def build_a_static_format(self, format, directory, postprocessor):
}
if self.config["buildVariable"] or self.config["interpolate"]:
args["interpolate"] = True
if self.config["useMutatorMath"]:
args["use_mutatormath"] = True
self.logger.info("Creating static fonts from %s" % source)
for fontfile in self.run_fontmake(source, args):
self.logger.info("Created static font %s" % fontfile)
Expand Down
1 change: 1 addition & 0 deletions Lib/gftools/builder/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
Optional("category"): UniqueSeq(Enum(CATEGORIES)),
Optional("reverseOutlineDirection"): Bool(),
Optional("interpolate"): Bool(),
Optional("useMutatorMath"): Bool(),
Optional("checkCompatibility"): Bool(),
Optional("removeOutlineOverlaps"): Bool(),
Optional("expandFeaturesToInstances"): Bool(),
Expand Down

0 comments on commit 8671c4b

Please sign in to comment.