There are two kinds of paths. Good ones and bad ones. Here’s how to spot the bad ones and how to correct or avoid the most frequent problems. You’ll be so glad you’ve read this tutorial!
Badly drawn outlines can cause headaches. 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.
‘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, cusp curves or even self-intersections, all of which may put a rasterizer into trouble.
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:
Inflections
At first sight, the magic triangle implies that a curve segment should only have a single orientation, i.e. not inflect, not switch from clockwise to counterclockwise. There are, however, many exceptions.
Very often, you are better off without an inflection when drawing glyphs like an S or a tilde, especially if you are drawing for interpolation. If your design intention allows it, and both handles of the segment are orthogonal (i.e., vertical or horizontal), there is no technical need to add an inflection. And fewer points mean less trouble. So, wherever possible, keep it like in the s on the left side:
However, if you cannot get your s curve to flow the way you want it without an inflection point, add it by choosing the Draw tool (P), holding down the Shift key and clicking approximately in the middle of the segment. Glyphs will add an on-curve point at the nearest inflection, like in the s on the right side.
Do try to avoid inflections though, because they may create a problem in interpolation. The diagonal triplet of on-curve point and the surrounding two handles can cause a so-called ‘kink’ in interpolated steps between masters. Read more about it in the Multiple Masters tutorial on how to keep your outlines compatible, there is a whole section dedicated to kinks.
Special case: When you draw cupped serifs in a font that is supposed to be optimised for the screen, you even need curve segments without inflections:
Make sure Points A and C are on the same height, all the BCPs are horizontal (or between the heights of B and A/C, i.e. they do not go beyond the area spanned by these two heights), and the distance between the base and B is less than 20 units. In File > Font Info > Font, add a blueShift custom parameter with the depth of your cups plus one as value. Then the PostScript autohinter can apply a so-called flex hint, which suppresses display of the cups at very low resolutions. And most importantly, make sure B sits on the baseline. Yes, you heard right, the B point! And the cup parts with the A and C need to immerse completely in the baseline alignment zone. Read more about PostScript hinting.
Path orientation and order
Wrong path directions can mess up counters and make proper hinting impossible. 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.
By the way, Paths > Correct Path Direction (Cmd-Shift-R) also re-orders your paths and resets the starting point in each closed path.
Working with multiple masters? Hold down the Option key, and the menu command will change to Paths > Correct Path Direction for All Masters (Cmd-Opt-Shift-R), which, as the name implies, will do its magic on all layers of the selected glyph(s) simultaneously. Comes in handy when you want to quickly make a glyph with multiple masters compatible again. You can quickly cure most interpolation problems this way. Read more about keeping outlines compatible.
Self-intersection
A path in an exported 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). But then again, in your Glyphs file, you may want to keep an intersection for easier editing and better interpolation. In this case, make sure you activate the Remove Overlap option when you export your font (Cmd-E).
Hint: This does not apply to Variable Fonts.
You can even add overlaps with the Open Corner and Reconnect Nodes commands from your context menu:
There is one problem with keeping overlaps though: double overlaps. That is, if you have another overlap inside an overlap. They may show as tiny white gaps inside your shapes. This can happen when, inside the overlap, a curve segment connects to a straight line, and the curve bends a little too much to the wrong side:
How can we find these spots? Well, a Python script could have a look at what your glyphs would look like after overlap removal, and see if there is some outline debris left over somewhere. In the mekkablue script repository, there is a script called Paths > New Tab with Small Paths, which opens a new Edit tab with all the glyphs it can find that contain such a tiny path:
We're based in Bandung, but work with anyone & anywhere. Have a project or an idea in mind? Drop us a line.