Skip to content

Commit

Permalink
add "--no-generate-GDEF" command line parameter
Browse files Browse the repository at this point in the history
This adds the "--no-generate-GDEF" command line parameter which sets
the "generate_GDEF" variable which in turn is passed over to
glyhpsLib invocations to determine whether to auto-generate a GDEF
table or not.

Fixes googlefonts#702.
  • Loading branch information
fabiangreffrath committed Nov 12, 2020
1 parent cb957f4 commit 88bd8ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Lib/fontmake/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ def main(args=None):
"interpolating. Use if you share feature files of masters in "
"external files, as instances can end up elsewhere.",
)
outputGroup.add_argument(
"--no-generate-GDEF",
dest="generate_GDEF",
action="store_false",
help="Do not auto-generate a GDEF table, but keep an existing one "
"intact.",
)

contourGroup = parser.add_argument_group(title="Handling of contours")
contourGroup.add_argument(
Expand Down
5 changes: 5 additions & 0 deletions Lib/fontmake/font_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def build_master_ufos(
family_name=None,
mti_source=None,
write_skipexportglyphs=True,
generate_GDEF=True,
):
"""Build UFOs and MutatorMath designspace from Glyphs source."""
import glyphsLib
Expand Down Expand Up @@ -170,6 +171,7 @@ def build_master_ufos(
instance_dir=instance_dir,
write_skipexportglyphs=write_skipexportglyphs,
ufo_module=ufoLib2,
generate_GDEF=generate_GDEF,
)

masters = {}
Expand Down Expand Up @@ -393,6 +395,7 @@ def save_otfs(
inplace=True,
cff_version=1,
subroutinizer=None,
generate_GDEF=True,
):
"""Build OpenType binaries from UFOs.
Expand Down Expand Up @@ -646,6 +649,7 @@ def run_from_glyphs(
family_name=None,
mti_source=None,
write_skipexportglyphs=True,
generate_GDEF=True,
**kwargs,
):
"""Run toolchain from Glyphs source.
Expand Down Expand Up @@ -675,6 +679,7 @@ def run_from_glyphs(
family_name=family_name,
mti_source=mti_source,
write_skipexportglyphs=write_skipexportglyphs,
generate_GDEF=generate_GDEF,
)
try:
self.run_from_designspace(designspace_path, **kwargs)
Expand Down

0 comments on commit 88bd8ce

Please sign in to comment.