Multiple Masters, part 2: Keeping your outlines compatible

  • by Rainer Erich Scheichelbauer
  • Tutorial
  • – Modified on

Understanding Outline Compatibility

When interpolation happens, what actually is being interpolated are the x and y coordinates of each and every node, handle, component, and anchor. Points and components are stored in a specific order, which must be the same in every master.

In short, to interpolate, we need compatible outlines. To achieve outline compatibility, we must make sure:

  • all masters have the same amount of paths, nodes and handles, as well as components
  • all components, paths, nodes and handles are in the same order across all masters.
  • all masters have the same set of anchors

That’s it! That’s all we need to make the magic of interpolation possible.

Making Sure Outlines are Compatible

Glyphs helps you keep your outlines compatible. Glyphs with incompatible outlines are marked with a red triangle in Font View or a red stripe at the top in Edit View. However, the red indicator will only be shown if there is at least one instance set with interpolation values different from the master values. In other words, Glyphs will bug you about the incompatibility of your outlines only if you are actually trying to interpolate something.

So, until we have an instance, we can make use of the very handy View > Show Master Compatibility (Ctrl-Opt-Cmd-N). The Compatibility View indicates a couple of things:

  • Compatible outlines are marked green.
  • Compatible outlines with potentially troublesome deviating angles are marked in yellow.
  • Incompatible outlines are marked red.
  • Selected points show blue lines that connect them to their respective counterparts in the other masters.
  • The numbers indicate the order of the paths and their starting points.

If everything is fine, it should look something like this:

If you are not happy with the way Glyphs shows the compatibility, you can change it in Preferences >User Settings and tick off Master Compatibility with Offset:

Some people prefer it that way:

Yay! You see, only green lines, and all the blue lines connect the right dots with each other. In any event there is nothing to fix here, and we can move on to the next letter.

This case is already a different story:

The counter is yellow. This means that the shapes are compatible, so it will interpolate alright, but there might still be something wrong. Now, sometimes, this is just a false alarm, because Glyphs must do some guessing, and cannot always guess right. But pretty often, it rightfully indicates an angle changing too much. In this case, the blue lines show that the vertical parts change into a horizontal position in the other master and vice versa.

Such situations are usually fixed by invoking Paths > Correct Path Direction (Cmd-Shift-R) and perhaps also Paths > Tidy Up Paths (Cmd-Opt-Shift-T) in all masters. If you are lazy, you can also press Cmd-Opt-Shift-R to correct the path direction in all masters at once. To quickly check if all paths are in the same order, go to Filter > Fix Compatibility. Now, if needed, you can easily correct any mistakes by dragging them in the right order.

Now, take a look at this hopeless case:

Oh no, the blue lines shoot across the picture in just any old way they please. And my goodness, there even is a completely incompatible red segment. Interpolations of this letter will not export. So, what do we do?

Well, all is not lost, since we can still switch between masters with Cmd-1 and Cmd-2. Our job is simply to make sure that all masters have the same number and order of nodes and handles, as well as the same number and order of paths. Also keep in mind that it is very important to have the same set of anchors in every master. Again, if you are lazy, check out mekkablue's script, which makes sure all anchors are replicated in all layers in the same relative positions.

Be Suspicious

One potential pitfall lurks in glyphs with two point-compatible shapes in each master, even when Glyphs marks the glyphs as compatible. Think of cases like the equal sign (=), the colon (:), quotedblbase („), or the divide sign (÷), just to name a few. If you take a look at these glyphs, with View > Show Master Compatibility enabled (Ctrl-Opt-Cmd-N), and you see the lines crossing or bypassing each other, well, you have a problem:

The masters are perfectly compatible, all outlines are green. But the lines indicate that the top dot is interpolating with the bottom one, and vice versa. Not good. Not good at all. Unless you want your divide sign to pingpong your dots around:

In this case, you can press Cmd-Opt-Shift-R to correct the path directions in all masters. This should reorder your paths automatically. If that does not fix it, you can try and reorder the paths manually by selecting and cutting one path after the other to the clipboard (Cmd-X) and immediately pasting it back again (Cmd-V), or with Filter > Fix Compatibility.

In order to find all glyphs that are in danger of being pingponged around, you can use the script Masters > Open Tab with Dangerous Glyphs for Interpolation on mekkablue's Github.

Keep Your Overlaps

Now, you may once have heard that all path overlaps must be removed in a font. Well, forget about it, because this is a technical problem that Glyphs can take care of nicely. Actually, for the purpose of interpolation, keeping overlaps in the paths is much smarter. Here is one typical example to understand why:

Look at the leg of the R. You can see it bypasses the lower node of the bowl. Keeping the leg and the bowl separate ensures easier interpolation. Besides, it also makes editing the R much easier, which is nice.

In case you have removed overlaps already, or you have been avoiding overlaps from the start, you can get them back by selecting a corner node, bringing up the context menu and choosing Open Corner. Or select two nodes and choosing Reconnect Nodes from the context menu:

Avoiding Kinks

There is one serious problem you should know about. It can only occur if you have three points in line to form a smooth connection of some kind, like this:

Now, trust me on this. If this constellation meets both of the following criteria, you will run into problems: firstly, if the angles are different in the masters, and secondly, if the proportions between the points are different, i.e. the relation between the length between first and the middle point to the length between the middle and last point. Should all of this apply to one of your paths, a kink can happen in interpolation:

This means that either angle or proportions must be kept the same between masters, at least in the likely case that you want to avoid such kinks.

A good way to avoid running into these problems is to keep all your smooth curve connections either horizontal or vertical: Shift-click with the Pen tool (P) to add extremum points, then remove the diagonal points, one by one. That way, the angles are the same, and we do not need to worry about kinks anymore. Hurrah!

Sometimes, however, your design will require such a point constellation, and you will not be able to keep angles in sync in both masters. In this case, you will need to keep proportions in sync.

You have two options. You can either try to do that manually: select the middle point, and make sure it is green, i.e., defined as curve point rather than corner point. You can switch between curve (green) and corner (blue) by pressing the Return key. Then, hold down the Option key and move the point along the line between first and last point, either with the mouse or the arrow keys:

Or you use the Masters > Dekink Masters Script from the Mekkablue collection of Glyphs Scripts. The way you do that is as follows: you go to the Master where you think the proportions are best, select the middle point, and run the script from the Scripts menu. It will then find the corresponding constellation in all other masters, and push the middle point to the same relative position between the other two as in the visible master. Phew, sounds super-complicated, but it is not that difficult. Take a look at this short video and judge for yourself.

Now, ye all go forth and make your masters compatible!

Read on: Multiple Masters, part 3: Setting up instances

Update 2014-03-07: Added link to Python script in section ‘Be Suspicious’.
Update 2014-08-23: Updated link for the Dekink demo video.
Update 2015-07-21: Updated for Glyphs 2.