Feature suggestions: Constrain dragging to slant angle and to path

There are two features that would be extremely useful for me personally, and perhaps (hopefully) also for others, but which I cannot find a way to achieve in Glyphs:

1. Constrain/snap to slant angle when dragging

When designing uprights, being able to constrain the dragging movement of both nodes and handles to horizonal or vertical only is very useful, since those are the two basic axes of the font.

When designing italics, it’s still useful to be able to constrain nodes and handles horizontally, and it’s also useful to constrain handles vertically – but I don’t think I’ve ever had the need to constrain the movement of a node vertically. Conversely, I frequently find myself wanting to move a handle ‘up’ or ‘down’ analogously to constraining it vertically in a regular master – that is, along the vertical axis in the glyph, viz., the slant angle.

This feature has been suggested before, but with no real feedback. George Thomas’ comment on that thread is not really an argument against – not everything in an upright master aligns with a 90° vertical angle, but the ability to constrain dragging to 90° is still very useful, and the same is true for italics.

Constraining the drag angle could be done in two ways:

  • Add an extra modifying key for slant-based constraint – e.g., Shift constrains to 0° and 90° while Shift + Control constrains to 0° and the slant angle
  • Add an option that determines whether vertical constraint is 90° or the slant angle (with a shortcut to switch between the two)

My preference would be for the former, as that provides more flexibility, allowing you to switch constraint types even within the same drag operation. The latter would also require some sort of visual indicator of which mode you’re currently in, which would take up UI space.

Apart from constraining the drag angle there is the issue of snapping. With no constraining, nodes and handles currently snap to vertical and horizontal. An option (under Path, I guess?) to additionally snap to the slant angle would be very useful.

2. Constrain to path when dragging

This is perhaps more niche, but I sometimes find myself wanting to move a node further up or down the path, without changing the shape of the path. For example, if you have a curve whose shape is exactly how you want it, but there’s a node on it with slightly angled handles that you want to straighten, an obvious solution is to move the node along the curve slightly until its handles are fully horizontal or vertical. Or if you have a (non-vertical) stem where you want to have nodes on either side at the same Y position, you would move one of them up or down along the path until they were aligned.

This would only apply to nodes, of course, and – similar to nudging – it would require modifying the handles on both the selected node and its neighbouring nodes to maintain an identical segment shape, but I at least would find it useful. As far as I can tell, holding Control while dragging a node currently does nothing, so that could be used as a modifier key to do this.

@alexs has plugins for this, if I’m not mistaken. I don’t remember their names, but search for Slobzheninov in the plugin manager.

Hmm, I don’t see anything that looks like it matches this. There’s the Green Harmony plugin that moves a node to its G2 position to create a harmonised curve, which is somewhat related to 2, but not quite the same thing (for one thing, it changes the curve).

I took Toshi’s comment in the older thread to mean that modifications to dragging are not available via the API and therefore cannot be done with scripts or plugins (or perhaps it’s only inaccessible to scripts but can be added in plugins?).

For the first, align scripts might help (recommended with shortcuts) — if you run it with 1 node selected, it will align it to its previous/next point* taking into account the italic angle. After that, just hold option and drag keeping the angle.
*it also aligns to metrics, zones and half width/heights, so run it multiple times to snap to the next closest item from that list.

For the second, uhh yes Sebastian I still haven’t published it, need to check for bugs. Is there any directory of all non-default tool plugins’ shortcuts and positions to avoid collisions?

I haven’t tried it out yet, but this doesn’t sound like quite the same thing, unless I’m misunderstanding what you mean by “align to its previous/next point”. I’m not looking to align a node to other nodes, but to drag the node or path freely in the space, independent from any other element, but along the slanted axis.

To give an example, let’s say you have your diacritic marks all set up to align nicely above your letters horizontally, but you think they’re a bit too close to (or far away from) the base letters, so you want to shift them up or down. You select the shapes in the mark glyph and drag them up/down – easy in an upright master where you just hold Shift while dragging, harder in an italic master.

1 Like

The upcoming update for my Mark Zones plugin will offer exactly that.

It will respect the italic angle not only for shifting, but also for stretching.

1 Like

That looks brilliant for the specific case of marks – but it won’t add the ability to drag on the slant angle in general, right?

Unfortunately not. But I agree that dragging at an angle could make sense. Especially because the selection tool has this option already, kind of, where the selection rectangle can be angled.

1 Like

I yet have to see a real life application for this that cannot be handled better with nudging or reconstructing the curve entirely. Can you show me a situation?

Most of the times I want to do that, it’s because the node is not at the extremum where it’s supposed to be and I want to move it there (especially common in inherited paths and imported fonts). Nudging will alter the curve, which is a different operation; reconstructing the curve is a possibility, of course, as is adding extremes and then removing the debris … but sometimes it would just be easier to hold a modifier key and dragging a single point.

The extremum? You mean at an angle, so everything but an extremum? Can you show an example?

Not changing the shape of the curve: not possible. The smaller the curve and the bigger the curvature discrepancy between the two segments, the bigger the distortion will be. Plus grid rounding errors that are bigger the shorter the handles are. The only safe angles are those divisible by 90.

Edit: So what you need is a an on-curve in a place where the surrounding handles are in a specific angle? If that’s the italic angle (‘italic extreme’), there is a plugin solution for that. I’ll open an issue to add Shift-clicking at the italic angle.

Yes, at an angle somewhere that’s not an extremum. For example:

– to become:

Of course some curve adjustment will have to occur, but those two paths are pretty identical – the shift is quite minimal (and could probably be made more minimal by tweaking handles). Here I fixed it by adding extremes and then deleting the original node with the eraser tool, which auto-adjusts handles to keep the curve as identical as possible to the original.

The feature I’m thinking about here would let me select the non-extremum node and simply drag it right/down – the node would then move along the curve (keeping the shape of the curve as static as possible by adjusting the handles correspondingly). So moving the node clockwise along the curve would make the handles more and more vertical until the node hit the extremum point, at which point the handles would be completely vertical (as in screenshot #2).

I remember there being a tool like this in some piece of drawing software many years ago, but I don’t remember where it was. Perhaps Corel Draw?

I don’t quite follow you here. The two suggested features are completely separate – only the first one has to do with slanted angles, the second just relates to any segment on any path.

I would address this by Shift-clicking the path with the Draw tool to add a node at the extreme point, and then use the Select tool to select the other node and delete it with the Delete key:

Demo

No. I’m talking about the second one.

Let’s get our vocabulary straight here. A node is something between two segments. And what you want is a green node between two curve segments that specifically is not an extreme, but has the surrounding handles at a specific angle. The only way to currently do this currently is to rotate the whole shape with that angle, add an actual extremum and then rotate it back.

If the exact angle doesn’t matter, then Florian’s method is best and more precise.

Either I’m completely misunderstanding you, or you’re completely misunderstanding me here, because that’s almost the exact opposite of what I’m looking for. Extrema were just an example of the most common use case. The functionality itself is simply to drag a point freely, but constraining it to the existing curve – handle angles would have to be automatically updated while dragging, not based on any specific angle.

(Re-reading the initial post, I do see that I talked about segments when what I really meant was paths – edited to correct that.)

Let me try to illustrate with a different example, one that doesn’t involve extrema. Say I have this shape, with the rightmost node selected:

If I mouse-drag the selected point to the left with no modifier key, the shape changes like this:

Screenshot 2024-11-03 at 11.55.44

With the functionality I’m talking about here, the same dragging movement would maintain the shape unchanged (as much as possible) and result in this instead:

And if instead I dragged the node downwards, it would result in this:

In both cases, the shape outline (i.e., the complete path created by all the segments combined) remains unchanged, but the node’s position on the outline changes.

It’s not particularly hard to emulate by adding and deleting nodes (that’s how I did it here), but that requires having the final, desired position of the node worked out beforehand, which I at least often don’t when I’m drawing. As I started out by saying, this may be a niche thing, but it’s something I do find myself wishing I could do sometimes.

I haven’t fully read this thread but the last images brought to mind a (yet unreleased? but hopefully it will be someday) plugin that Alex Slobzheninov was working on which might the kind of feature you are describing

Alex Slobzheninov on Instagram: "🎮 Plugin that I occasionally wanted in Glyphs: move points along the path and beyond, while keeping its shape. Controlling multiple points clearly needs improvements. Colored with Presenter by @mark2mark_one for @glyphsapp"

That’s the plugin I mentioned earlier, yes.

I still don’t entirely understand what you need it so urgently for, but whatever.

@gor.jious Thank you for that – apart from the fine-tuning to keep the shape, that is precisely what I was trying to describe and illustrate!

@SCarewe It’s not an urgent need (suggestion #1 about constraining to the slant angle is far more important to me), but as the comments to the Instagram post shows, I’m not the only one who thinks it would be nice to have.

I would like to know in what situations this would be useful?

I have already given several use case examples further up.