Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow alternate layers to be unnamed #834

Merged
merged 2 commits into from
Nov 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/glyphsLib/builder/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def to_ufo_layers(self):
)
continue

if not layer.name:
if not layer.name and not layer._is_bracket_layer():
# Empty layer names are invalid according to the UFO spec.
if self.minimize_glyphs_diffs:
self.logger.warning(
Expand Down
7 changes: 7 additions & 0 deletions tests/builder/designspace_gen_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,13 @@ def test_designspace_generation_bracket_other_roundtrip(datadir, ufo_module):
def test_designspace_generation_multiaxis_bracket(datadir, ufo_module):
with open(str(datadir.join("Playfair-v.glyphs")), encoding="utf-8") as f:
font = glyphsLib.load(f)

# Remove names of bracket layers, make sure the layers get
# copied anyway
for l in font.glyphs["v"].layers:
if l._is_bracket_layer():
l.name = ""

designspace = to_designspace(font, ufo_module=ufo_module)
axes = designspace.axes
info = font.glyphs["v"].layers[8]._bracket_info(axes)
Expand Down