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

Point identifiers/names from Glyphs to UFO? #1049

Open
jenskutilek opened this issue Nov 19, 2024 · 2 comments
Open

Point identifiers/names from Glyphs to UFO? #1049

jenskutilek opened this issue Nov 19, 2024 · 2 comments

Comments

@jenskutilek
Copy link
Contributor

Is it possible to add some data in a Glyphs file so that it ends up as names/identifiers of points in the UFOs?

I've set GSNode.name in the Glyphs file, but the names don't make it to the UFO at all.

There is nothing in GSNode that seems to be corresponding to a UFO point identifier.

Following the spec, I would need more of an identifier than a name in the UFO. Identifiers are unique per glyph, and should not change when the outline is processed.

@jenskutilek
Copy link
Contributor Author

This is weird, a point's name will be taken from GSNode.userData, even though I think it should be taken from GSNode.name directly:

pen.addPoint(
tuple(node.position),
segmentType=node_type,
smooth=node.smooth,
name=node.userData.get("name"),
)
# NOTE: Can't do path_index, node_index through enumeration here because we
# might have changed node order.
# A node's name will be stored as a UFO point's name attribute, so filter
# it from the Glyph node user data to avoid storing duplicate information.
node_user_data = {k: v for k, v in node.userData.items() if k != "name"}
self.to_ufo_node_user_data(ufo_glyph, node, node_user_data)

Would it be desirable to add an identifier entry to GSNode.userData which will be transferred by glyphsLib as well?

@schriftgestalt
Copy link
Collaborator

I just had a look what Glyphs would do with the point.identifer. And it turned out it would ignore it. I fix that. So it is now stored in node.userData["UFO.identifier"].

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