11

It's apparently import to add anchor points at the horizontal and vertical extrema of your paths when designing the glyphs of a font. Most font editors have functions to add these for you and will give you an error if you omit them.

But it's sometimes easier and more natural to draw paths like this:

enter image description here

Notice the varied angles and lack of points on most extrema.

The following is a better path, but if you're starting with something like the first image then getting to this means an extra step in the process (sometimes having to retrace the original):

enter image description here

So why do we even need to add extrema points and what practical issues will I face if I don't?

2 Answers 2

8

As already mentioned, extrema are needed for font rendering and in particular hinting.

To understand this, let’s at first look at what roughly happens when autohinting a glyph with extrema as anchors (green) in a regular pixel grid¹: To make a font look nice and crisp, vertical and horizontal strokes should exactly fall into the pixel grid. An arbitrarily placed glyph² will usually not fulfil this criterion, and therefore the renderer will slightly distort it to that end, namely by moving the extrema, since they define the vertical and horizontal strokes:

illustration of the crucial part of the hinting process

This process requires guesswork by the renderer which is why the designer can define a bunch of things (marked stems, blue values) that assist the renderer in this process. Note that this is only one of the first steps and there is a lot going on after that, which we do not need to care about for this question.

Now, let’s first suppose we had not only used extrema to define the glyph but also some diagonal anchors in between. Then these anchors would have to be gradually moved when the extrema are moved, which again requires guesswork, but unlike moving the extrema, the font designer cannot do much to help with this due to the complexity of the situation. Therefore moving this surplus anchors is a considerable source of error, in particular if the anchors are close to the extrema.

Finally we can return to the question and consider what happens if we do not define any anchors at the extrema. In this case, the renderer has to automatically determine the extrema (which it can do easily) before moving them and all other anchors along with it. Since what you would naturally choose as an anchor is close to the extrema for many types of typefaces, this comes with a risk of bad guesswork due to the reasons elaborated above.

To somewhat summarise the above: Extrema play a crucial role when rendering anyway and therefore it is better if your glyph is built upon them so the renderer does not have to guess.

Quotes

From the patent US 7068276 B2 – Methods and systems for hinting fonts :

The algorithmic approach described below attempts to match up explicit on-curve knots using features such as contour direction and the presence of extrema.

From FontForge’s Wiki on hinting:

Contours need to have the right direction, otherwise snapping to blue zones is impaired. The less points form the (accurate) shape, the better. But curves hinted with H/V stems should have points at extrema, otherwise they won't get snapped. Its unelegant if such a point is 'implicit'.


¹ it’s not much different for subpixel hinting
² which is a broad simplification since glyph placement with hinting is more intricate; but it suffices for this example

3

Here are three reasons why "points in extrema" is the preferred method when working with bezier curves. In fact when working on lettering in particular I have seen it described as essential:

  1. It improves (greatly) autohinting and PostScript interpretation. Indeed setting points to extrema is one of the first steps when setting up manual hinting.
  2. Much easier to edit shape later. Editing the curves later is much easier with points in extrema. Moving points in extrema tends to keep the curves pretty with minimum additional effort.
  3. Less points overall. Extremum points also tend to achieve the same shapes with fewer additional points... which also results in smaller file sizes.

For these reasons many font software design programs have tools for highlighting and fixing points not at maxima and minima (the extrema).

Saying all that, I have long laboured to set all my points in extrema, and have never quite succeeded, but I do not consider myself a Bezier Ninja!

3
  • I get the hinting, though my reading of the specs makes me believe its a symmetric rounding issue. In unrelated news one should avoid inflection points. However i dont get the 2 other reasons. They are often cited but still. If this were true then rotated items have different optimum bezier handles which seems nontrue given how the object is constant at all orientations. So these points are really defects in authoring tools, and or faults in human brains.
    – joojaa
    May 26, 2017 at 21:27
  • If you go for 2 and 3, you’d rather use inflection points and possibly points of highest curvature (see this answer of mine). (CC @joojaa)
    – Wrzlprmft
    May 27, 2017 at 8:34
  • @Wrzlprmft yeah that i agree with, since inflection points are global to the shape. Also font engines really dislike curves that invflect so it kills 2 birds at the same time.
    – joojaa
    May 27, 2017 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.