Skip to content

Commit

Permalink
Fix brace layers in minimal build (#769)
Browse files Browse the repository at this point in the history
* Test for #741

* Fix for #741
  • Loading branch information
simoncozens authored Jan 25, 2022
1 parent 0cc52a0 commit 57e66d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Lib/glyphsLib/builder/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion tests/builder/designspace_gen_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 57e66d2

Please sign in to comment.