Wednesday, September 24, 2014

Strategies for setting letter spacing: part two

In the last post, we resolved the sidebearings of three letters—‘n’, ‘o’, and ‘v’, each representative of a class of letter shapes. These sidebearings can now be assigned to related characters with congruent sides. The sidebearings of the ‘n’ also work for the ‘m’ and the ‘i’ (but not necessarily letters like ‘l’ which has a taller stem and no head serif on the mean line). Since the left side of the ‘n’ is the same as the left side of the ‘r’, the left sidebearing of the ‘r’ can be taken from the corresponding sidebearing on the ‘n’. The same goes for the right side of the ‘h’, which matches the right side of the ‘n’. In Floribunda the right side of the ‘a’ also matches the ‘n’, but this is not always true.

The sidebearings on the ‘o’ can inform the ‘e’ and ‘c’ (the right sidebearings might need tweaking) and the bowls of the ‘b’, ‘p’, ‘q’, and ‘d’. The ‘v’s sidebearings set the sidebearings of the ‘w’ and the ‘y’.

Applying these sidebearings in fontforge is fairly simple and can be done from the main window. Simply select the glyphs in question and run MetricsSet LBearing (left sidebearing) and Set RBearing (right sidebearing).


There are two things to watch out for when doing this though. First, if you haven’t done so already, make sure all of your letters have their extremas. Sidebearings are calculated from on-curve points, so missing extremas can produce sidebearings that are optically too small.

Secondly, always run Set LBearing first. For whatever reason, if you run Set RBearing first, Set LBearing will simple translate the glyph over to produce the correct left sidebearing, without moving the right sidebearing along with it.

If you go to MetricsNew Metrics Window, you can type letters into the text box (next to the button that says “New Lookup”) and see the font in action.


The great thing about fontforge metrics is you can edit sidebearings (and even kerning) right from the table underneath the text preview (you can also drag glyphs on the preview, but I don’t recommend doing that for sidebearings since it only adjusts one letter’s sidebearing per pair).


A good way to go about this is to type the letter you’re setting the sidebearings for in between two letters of each type (stemmed, round, diagonal). Then just edit the sidebearing in question—here, the left sidebearing of the ‘a’—until it looks right.

Here, you can see that a sidebearing of 5 is too narrow.


60 on the other hand is too wide.


32 is just right. If you’re unsure, go with a wider sidebearing. Overspaced type is usually more bearable than underspaced type.


Here, I’m determining the left sidebearing of the ‘b’.


Generally the most important factor in letter spacing is the distance between stems (or the thick part of a bowl). That’s why the left sidebearing of the ‘n’ looks fine on the ‘b’ despite the ‘b’s taller stem.


The presence of serifs and other protrusions can skew the ideal spacing slightly (slightly!) wider than it would be without them. Because the serifs take up some of the space between the letters, the gap frequently needs to be made subtly wider to make the gap appear the same width as it would without the serifs. Because of this, the ‘b’, which lacks any mean line or baseline serifs takes a slightly narrower sidebearing than the ‘i’ or ‘n’ would.


The ‘d’ will take a right sidebearing very similar to the one of the ‘n’, since it has a serif on the baseline.


For letters that we have to resolve two sidebearings for, place stemmed, round, and diagonal letters on both sides of them. This lets us see how the letter behaves when surrounded by all three types of shapes at the same time.

The left side of the ‘f’ is so similar to the ‘i’ that it should take a very similar sidebearing to it. The overhang on the ‘f’ means that it will need to have a negative right sidebearing to look right (in fact I would even go down to –70 instead of the –50 in this picture).


You should be able to use this approach to space the rest of the unspaced alphabet. Note that since the right side of the ‘j’ lacks any serifs at all, it’ll need a much wider sidebearing to compensate.


Some common considerations in letter spacing:
  • Narrow letters like ‘i’, ‘l’, and ‘j’ benefit from slightly thickened sidebearings. It prevents them from being crushed into each other and other stemmed letters when they occur next to each other. It also prevents a black rectangle from forming in words like “Illinois”.
  • Letters like ‘e’ and ‘c’ are narrower than the ‘o’. However the right sidebearing compresses less than the letter itself, so the ‘e’ and ‘c’,  have wider right sidebearings. The ‘c’, with its open contour, in turn has a narrower right sidebearing than the ‘e’, sometimes taking that letter’s sidebearing right back where it started.
  • The right sidebearing of the ‘y’ should be slightly narrower (or more negative) than that of the ‘v’, because of the huge negative space its tail forms. The ‘x’ should have wider sidebearings since it has four serifs and stokes that reach all four corners of its bounding box.
  • Most letter spacing adjustments are to counter optical illusions. That means that if the compensation itself is noticeable, you’ve gone overboard.
  •  Some letter pairings, usually involving letters like ‘v’ or ‘c’ are unresolvable (like the “avid”–“love” problem in the previous post). In that case, just make a compromise and make a note to come back and kern those pairs later.
Finally, just set the word space. The word space is what we usually call the “space” character ‘ ’. It’s found all the way at the beginning of the ASCII block, right before the exclamation point in fontforge. Set its width by dragging its sidebearing. The word space for a roman (non italic) font is almost always between a quarter and a third of an em; usually closer to a quarter em than a third em.