Copy Layer to Layer: Corner Components

Hey guys,

I’m finding corner components are oft left behind in operations such as cutting and pasting paths, creating a component from selected paths, the ‘Copy Layer to Layer’ script (from https://github.com/mekkablue/Glyphs-Scripts) etc.

Is there a possibility of adding ‘Corner Components’ to the checkbox list of included items in the scripts dialogue (currently Components, Anchors and Metrics)?

Aside: Based on my experience with using corner components so far (which has mostly been great), double clicking a path to select it should also select any attached corner components as well. It would make life so much easier!

Thanks heaps,

Dave.

Why do you want to select both a path and the corner components at the same time?

not familiar with the copy layer to layer,
but i fiddle with a script that copys all corner components of the current layer to the other master layers

Font = Glyphs.font

for selectedLayer in Font.selectedLayers:
glyph = selectedLayer.parent

for hint in selectedLayer.hints:
	if hint.type == CORNER:
		for layer in glyph.layers:
			if layer == selectedLayer:
				continue
			
			hasHint = False
			for existingHint in layer.hints:
				if existingHint.type == CORNER and existingHint.originNode != None and existingHint.originNode.index == hint.originNode.index:
					hasHint = True	
					break	
		
			if not hasHint:
				newHint = hint.copy()
				layer.hints.append(newHint)

Internally, the corners are not part of the nodes itself. So each method that copies a path, needs to keep track of them. So if you could specify each place where is not working we can fix it.

In this case to copy all or part of a glyph over to another glyph. I want the serifs to come too.

This is handy, thanks for sharing, @dergraph!

Not sure if there’s been an update since this conversation, or whether I’m not able to reliably reproduce the issue right now, but all seems well! I’ll let you know if I find anything. Thanks Georg.

Copy pasting the whole path will keep the corners. I have a look at the other operations that you mentioned.

This is great, thanks Georg.

Just found that ‘swap with background’ does not keep the corners. Build 919.

not sure if this has been also covered.
been using the script myself more often lately.
just ran into the case that caps are not being copied too.
now if we have checkboxes to activate copying components anchors and the likes, any other element should be possible to transfer form layer to layer in the same style.

including caps and corners maybe with dedicated checkboxes

I fixed the caps not being copied earlier today.