Sharpen corner in all masters

Is there a way to sharpen a corner in all masters, as there is to open a corner in all masters?

1 Like

That is currently not possible. But I put it on the list.

2 Likes

Thanks!

Hello again, this seemingly hasn’t made it off the list yet – in order to get it done via a script, would you be able to tell me what function I can call? I have dug through the documentation a bit but can’t find anything that works (or figure out which arguments are required for undocumented methods I found via the Method Reporter). Thank you!

1 Like

Perhaps this snippet helps:

selectTool = NSClassFromString("GSToolSelect").alloc().init()
selectTool._makeCorner_firstNodeIndex_endNodeIndex_(Layer.paths[0], 30, 36)

That is implemented in the next upcoming update.

2 Likes

Great news, thanks!

This hasn’t made it into 3.1.1 (3141)?

I tried with the snippet above which sharpens the open corner on that master but then it throws all the corner components out of whack.

It will be in the 3.2.

I’m looking forward to this too.

It is available in the current betas. Go to Glyphs > Preferences (or Settings) > Updates, activate both checkboxes and press the Update button.

is there a way to reach open and sharpen corner features from the contextual menu via script?

Open:

layer.openCornerAtNode_offset_(node, 100)

Sharpen is a bit more complicated. This needs more work and adjustments depending what you like to do.

# this is one option to get the index
print("__idx1", Layer.selection[0].index)


currentController = Font.parent.windowController()
if currentController:
	tool = currentController.toolEventHandler()
	print("__tool", tool)
	if tool.__class__.__name__ == "GlyphsToolSelectNormal":
		path = Layer.selection[0].parent # get the path as it fits your script. 
		startIdx = 9 # the indexes need to be set, e.g. from the selection
		endIdx = 12
		tool._makeCorner_firstNodeIndex_endNodeIndex_(path, startIdx, endIdx)
1 Like

This _makeCorner_firstNodeIndex_endNodeIndex_ function doesn’t seem to work properly if the range of nodes crosses over the start/end of the path’s node list.

For example, the selected segment here would be startIdx=6, endIdx=2.

But tool._makeCorner_firstNodeIndex_endNodeIndex_(Layer.path, 6, 2) gives this weird result:

that method, when called by the “make corner” command, is using “-1” and “2” as indexes.