Drawing good paths

  • by Rainer Erich Scheichelbauer
  • Tutorial
  • – Modified on

Badly drawn outlines can cause headache. Your letters may look mangled or not appear at all. You can avoid these difficulties if you keep a few basic rules in mind.

The magic triangle

This is important: every curve segment should fit nicely in a triangle.

goodpaths-1

‘What’s a segment?’ I hear you ask. Simple, it’s everything between two adjacent on-curve points a.k.a. nodes. There are two types of segments, straight lines and curves. Straight lines only consist of those two nodes. Curve segments additionally sport two off-curve points a.k.a. Bézier control points (BCPs) or ‘handles’.

It’s important to note that the magic triangle is described by the two nodes encompassing the segment and the point where the elongations of the handles intersect. This means that the handles must never extend outside the triangle. If they do, you may want to reconsider the position of your nodes. So these two things should not happen: a handle crossing the other handle, and a handle crossing the elongation of the other handle. This may produce unnecessary inflections, double-inflections, cusp curves or even self-intersections, all of which may put a rasterizer into trouble.

goodpaths-2

This may come as a surprise to you if you have prior experience in vector applications like Illustrator. First, the handles do not belong to the nodes, but to the segment. Secondly, a curve segment always has two BCPs, never just one. Illustrator seems to let you draw curve segments with only one BCP. But actually, what Illustrator really does is hide the second BCP in one of the surrounding nodes. This is pretty bad because in font vectors, no two points should share the same coordinates. Plus, you have more control over the path if you make good use of both BCPs.

If one of the BCPs appears to be missing, it’s hiding in the node next to it. The easiest way to fix this is to select a point in the vicinity, be it a handle or a node, and then tab to the hiding handle. Use Shift-tab to go into the opposite direction. A light-grey highlight indicates that the handle is selected. Now, use your arrow keys to drag the handle out of the node. If you add the option key, your handle will keep its direction. Hold down Shift for increments of 10:

goodpaths-6

The triangle rule also implies that a curve segment should only have a single orientation, i.e. not switch from clockwise to counter clockwise. There are, however, exceptions to this rule. Very often, you’re better off with a double inflection when drawing glyphs like an S or a tilde, especially if it’s only a small path movement. When you draw cupped serifs, you even need to have double inflections:

goodpaths-3

Make sure Points A and C are on the same height, all the BCPs are horizontal, and the distance between the base and B is less than 20 units. Set your postscriptBlueShift custom parameter to the depth of your cups plus one. Then the autohinter can apply a so-called flex hint.

Path orientation and order

Wrong path directions can mess up counters. Paths need to be oriented counter-clockwise, counters need to be oriented clockwise. You can control path directions by selecting paths, right-clicking and picking Reverse Selected Contours from the context menu. Don’t wanna keep that in mind? No problem. Glyphs can do that for you. Just pick Paths > Correct Path Direction (Cmd-Shift-R) and you’re done. This command also works on multiple glyphs, or even the whole font.

goodpaths-4

By the way, Paths > Correct Path Direction (Cmd-Shift-R) also re-orders your paths and resets the starting point in each closed path. You can quickly cure most interpolation problems by running this command in each master.

Self-intersection

A path in a font must not intersect itself. You can fix a self-intersection by selecting the contour in question and choosing Filter > Remove Overlap (Cmd-Shift-O).

Sometimes, of course, you will want to insert an intersection for design purposes. In this case, make sure you activate Remove Overlap when you export your font (Cmd-E).

Superfluous points

Not really a biggie, but it can improve the rendering performance of your font: Paths > Tidy Up Paths (Cmd-Opt-Shift-T) will remove superfluous nodes and BCPs. This command will also fix the type of your nodes, thus changing a blue corner point into a green curve point (or vice versa) where necessary.

Extremum points

While we’re at it, a lot of stuff is much easier if you insert nodes at the x and y extremes of your paths. Very often, this allows you to get rid of the other points while achieving simpler paths, fewer points, smaller file sizes.

You can either choose Paths > Add Extremes to add extrema to the selected outlines, selected glyphs or even the whole font. Or, if you want to have more control, just take your Pen tool (P) and Shift-click on the path. Glyphs will look for the nearest extremum or inflection point of the curve and insert a node there.

After you inserted extremum points, you can often get rid of intermediate points without compromising on the shape:

goodpaths-5

Open and closed

Did a whole path go missing in the final font? Perhaps it was open. Open paths are ignored at export time. So, all paths should be closed.

To close a path, just drag one of the open ends onto the other one with your Edit tool (V). Or switch to the Pen tool (P) and subsequently click on both end points to add a closing segment.

Vectors out of bounds

Got super-weird left or right sidebearing values? You probably have some object way off the visible part of your glyph. Here’s how to get rid of it:

  1. Make sure the right glyph is active, i.e. the cursor is placed before it.
  2. Switch to the Edit tool by clicking on the arrow symbol in the toolbar.
  3. Choose Edit > Select All (Cmd-A). All paths in the glyph are selected now.
  4. While simultaneously holding down your Shift key, drag a rectangle selection across the parts you want to keep. This will deselect them. Now, only the out-of-bounds debris remains selected.
  5. Hit the Delete key.

Now is a good time to go through your glyphs and optimize the vectors. Trust me, it will save you some hassle later.