googlefonts/glyphsLib

Point identifiers/names from Glyphs to UFO?

jenskutilek opened this issue · 2 comments

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.

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?

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"].