From 48ba8f1c70bba127957c6284e07411d1d4a59499 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 7 Feb 2024 13:28:17 +0000 Subject: [PATCH] [glyphs2ufo] add --no-propagate-anchors CLI option Fixes https://github.com/googlefonts/glyphsLib/issues/906 --- Lib/glyphsLib/cli.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Lib/glyphsLib/cli.py b/Lib/glyphsLib/cli.py index a24fe671d..1a6b23ece 100644 --- a/Lib/glyphsLib/cli.py +++ b/Lib/glyphsLib/cli.py @@ -85,16 +85,26 @@ def main(args=None): "roundtripping between Glyphs and UFOs." ), ) - group.add_argument( + anchor_group = group.add_mutually_exclusive_group() + anchor_group.add_argument( "--propagate-anchors", default=None, action="store_true", help=( - "Copy anchors from underlying components to actual " - "glyph. Glyphs would do this implicitly, only use if you need " - "full control over all anchors." + "Copy anchors from underlying components to actual glyph " + "(Glyphs would do this implicitly upon export). By default, if this option " + "is not explicitly used, glyphs2ufo checks the 'Propagate Anchors' font " + "custom parameter and if unset or set to 1 (true) then the anchors get " + "propagated. Pass this option to enable this overriding the parameter." ), ) + anchor_group.add_argument( + "--no-propagate-anchors", + dest="propagate_anchors", + default=None, + action="store_false", + help="Disable anchor propagation regardless of any custom parameter.", + ) gdef_gen_group = group.add_mutually_exclusive_group() gdef_gen_group.add_argument( "--generate-GDEF",