Copy corner of extra nodes

There are two extra node with corner in one layer, I want to copy all the shapes/paths and its corners to another layer, but can’t copy its corners to another layer through script. Only copied the shapes.
I founder the function copy does not work for extra nodes’ corners.
Do you have any solution.
Thanks a lot.

import copy

layer = Glyphs.font.glyphs['uni4E08'].layers[0]
shape = []
for s in layer.shapes:
	shape.append(s.copy())
print(shape)
Glyphs.font.glyphs['uni4E07'].layers[0].shapes.extend(shape)

New Font.glyphs (10.2 KB)

The corners are in layer.hints.

What exactly are you trying to do? Mayer copy the layer and replace it in the other glyph?

Yes, it works.
We want to try to combine Chinese glyphs through different stroke paths with corner.:slight_smile:
Thanks.

I found if copy different layer’s hint(corners) together to one glyph’s layer, some corner will locate in wrong position.
Such as belowing example script, after excuting to copy all shapes and hints(corners) together to ‘layer’, the layer4’s corner will locate in wrong position, it will stick to the layer5’s corner.
Do you have any suggestion?
Thanks.

import copy

layer1 = Glyphs.font.glyphs['uni4E01'].layers[0]
layer3 =  Glyphs.font.glyphs['uni4E03'].layers[0]
layer4 =  Glyphs.font.glyphs['uni4E04'].layers[0]
layer5 =  Glyphs.font.glyphs['uni4E05'].layers[0]
layer =  Glyphs.font.glyphs['uni4E07'].layers[0]

print("done")
layer.clear()
layer.shapes.extend(layer5.copy().shapes)
layer.hints.extend(layer5.copy().hints)
layer.shapes.extend(layer1.copy().shapes)
layer.shapes.extend(layer3.copy().shapes)
layer.shapes.extend(layer4.copy().shapes)
layer.hints.extend(layer4.copy().hints)

New Font.glyphs (11.1 KB)

And I found if you copy manually not through script is also wrong result.