diff --git a/Lib/glyphsLib/builder/builders.py b/Lib/glyphsLib/builder/builders.py index e1d389661..d9fcb420e 100644 --- a/Lib/glyphsLib/builder/builders.py +++ b/Lib/glyphsLib/builder/builders.py @@ -326,7 +326,11 @@ def to_ufo_layers(self): and ".background" not in layer.name ): self.bracket_layers.append(layer) - elif self.minimal and layer.layerId not in master_layer_ids: + elif ( + self.minimal + and layer.layerId not in master_layer_ids + and not layer._is_brace_layer() + ): continue else: ufo_layer = self.to_ufo_layer(glyph, layer) diff --git a/tests/builder/designspace_gen_test.py b/tests/builder/designspace_gen_test.py index 79dc43b05..be8161e6b 100644 --- a/tests/builder/designspace_gen_test.py +++ b/tests/builder/designspace_gen_test.py @@ -161,7 +161,7 @@ def test_designspace_generation_same_weight_name(tmpdir, ufo_module): def test_designspace_generation_brace_layers(datadir, filename, ufo_module): with open(str(datadir.join(filename))) as f: font = glyphsLib.load(f) - designspace = to_designspace(font, ufo_module=ufo_module) + designspace = to_designspace(font, ufo_module=ufo_module, minimal=True) axes_order = [ (a.name, a.minimum, a.default, a.maximum, a.map) for a in designspace.axes @@ -192,6 +192,9 @@ def test_designspace_generation_brace_layers(datadir, filename, ufo_module): assert masters[source.filename] is source.font masters[source.filename] = source.font + # Check that brace layer glyph is created + assert len(designspace.sources[0].font.layers) == 2 + @pytest.mark.parametrize("filename", ["BraceTestFont.glyphs", "BraceTestFontV3.glyphs"]) def test_designspace_generation_instances(datadir, filename, ufo_module):