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

Names shouldn’t be required for intermediate/brace layers either #996

Open
lianghai opened this issue Apr 10, 2024 · 5 comments
Open

Names shouldn’t be required for intermediate/brace layers either #996

lianghai opened this issue Apr 10, 2024 · 5 comments

Comments

@lianghai
Copy link

I programmatically created some intermediate/brace layers (without GSLayer.name) in Glyphs, and they worked fine, but glyphsLib isn’t able to export them to UFO layers because of this validation:

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(
'{}, glyph "{}": Contains layer without a name which '
"will be skipped.".format(self.font.familyName, glyph.name)
)
continue

The condition not layer._is_bracket_layer() should be extended to cover any types of layer that have a synthesized name in the built UFO, in particular intermediate/brace layers.

@schriftgestalt
Copy link
Collaborator

I’m working on it. You can try by switching to the Glyphs3 branch.

@lianghai
Copy link
Author

Good to know it’s a known issue. For now I’ll just make sure GSLayer.name is not empty. 👌

@schriftgestalt
Copy link
Collaborator

Can you try with the code in the "Glyphs3_merge" branch. It seems to work for me, now.

@lianghai
Copy link
Author

lianghai commented May 4, 2024

Sorry, I’ll just wait for a stable release before verifying this.

The other day I did notice some other symptom that suggests the current stable glyphsLib relies on unique layer names (which is inconsistent with Glyphs’s usage of layer IDs). The reliance on unique layer names causes unexpected conflicts of layers.

@schriftgestalt
Copy link
Collaborator

It would be good to verify the fix before releasing it. Could you send me a test file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants