-
Notifications
You must be signed in to change notification settings - Fork 51
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 brace layers with the same coordinates to have different associatedMasterId #956
base: main
Are you sure you want to change the base?
Conversation
master_id = sorted(master_ids)[0] | ||
for other_master_id in master_ids: | ||
self._where_to_put_brace_layers[key, other_master_id] = master_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like you are doing this twice (also in builder/builders.py:150-152)? why?
# ... as they may need to be filled up with the values of the | ||
# associated master. | ||
master = self._sources[master_id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure you're filling up the values from the actually associated master and not from the first one that you picked when multiple ones are available?
the proposed solution sounds ok to me, but maybe the PR needs some clean up work. |
Discussing this with @schriftgestalt , he suggests that the default behaviour of glyphsLib could be cleaner on the UFO side (as there's not a problem anymore of "under which full UFO to put the sparse layer". However this is harder to round-trip because it loses the association to a specific master on the Glyphs.app side |
Georg adds that merging his Glyphs3 branch should probably be a reason to bump the major version number, and that could also be an opportunity to change the default output for brace layers from layers to standalone UFOs. One question with standalone is how to choose the filename of the UFOs, and it could be some combo of axis tags + values joined by underscores. |
I disagree that using standalone UFOs instead of UFO layers referenced from DS source via layer attribute is a solution here. |
But all projects (that I have seen recently) that are build as designspace/ufo (not in Glyphs) have the sparse masters in separate .ufos (with or without extra font info/kerning). So it would be good to being able to read/write those designspace files without massively changing the file structure. Extra ufos makes it easier to edit/audit them. And the vertical metrics defined in the full/"parent" source are most likely not going to match the outlines in the brace layers, because those need to be interpolated from the surrounding sources. |
why?
the sparse UFO layers don't have define any global metrics of their own, their parent UFO does, so they don't contribute to the interpolation of vertical metrics, similarly to the Glyphs.app's brace/intermediate layers themselves, which only contribute glyph outlines and glyph advances. |
because you can open them in any ufo editor and just edit the included glyphs. Otherwise you need to hunt down the layers of the other glyphs? |
UFO editors (Robofont) should allow to select the layer you want to edit |
But does it show what glyphs have multiple layers or lets filter for glyphs that have? |
Glyphs.app allows brace layers with the same coordinates to have different associatedMasterId. The same situation is not allowed in Designspace + UFO (because you can't have 2 sources with the same location), so the idea for a fix is: for each brace layer location, select one UFO = designspace source that will receive all the brace layers for that location.
Related issue: #925
NOTE: the code is very ugly, I was just exploring ideas of how to fix this. I marked as Draft for now.
Example that works without this patch:
Example that needs this patch to work: