Why add extrema points when designing fonts?

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?

Answer

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

Attribution
Source : Link , Question Author : Cai , Answer Author : Wrzlprmft

Leave a Comment