Roadmap

(A great place to start if you're new here is my Wide Spacing Roadmap.)

Tuesday, April 21, 2015

The Magic of the Modern Font

One of the oft-repeated myths around sentence spacing is that modern fonts don't need an extra space because the fonts know how to fix sentence spacing.

What does that mean, exactly?  The statement is so vague as to be meaningless.  What needs to be fixed?  How is the fixing accomplished?  How does the font magically determine what is and is not a sentence?

If you feel that sentences don't need any extra space at all, I suppose you could argue that fonts do nothing, and that this “fixes” the problem.  But I really don't think this is what anyone means.  Everyone seems to believe that the font is doing something.  What could it be doing?

The answer is, not much.  Fonts have almost no magic built into them (except for the scaling and low-resolution rendering magic, which is impressively magical).  But they do have pair-kerning, and this may be the magic that some people are putting their faith in.

Kerning is the adjustment of the overlap of, or space between letters (or other characters).  Historically, a kern used to be the piece of metal that stuck out on letters that needed to overlap.  For example the upper-case T should overlap with most letters.  For letters where this wouldn't work, typesetters had to insert an extra space to avoid a collision with the kern.  And “kerning” itself didn't really exist, other than as a word for manufacturing type to a given (and permanent) width.  Once a font was created, kerning was never adjusted.



But these days, you can't shake a stick without hitting some hipster designer babbling on about how he tuned the eff out of the kerning in his new t-shirt design.  Of course, this is always about a designer making a mostly graphical design with some text.  Nobody actually goes through and tinkers with the kerning of the text in the middle of their term paper.  For plain text, people use the kerning that is built into a font, just like they did with handset type.

In modern fonts, each character is created with a default width, much like the physical width of the sorts back in the day.  But modern fonts have this concept of pair kerning too.  Pair kerning makes adjustments to the kerning for specific letter pairs.  For example with the letter T, you want letters that could tuck under it to actually do so, otherwise they will appear much too spacey.  All good modern fonts do this, and they do it all the time for everything.  This means I can type in a sequence of letters like “LYAVATJ”, and the pair kerning built into the font should know that every single one of these letter combinations is special, and requires a bit of extra adjustment.  This makes modern fonts far superior in their unaltered spacing to old handset fonts.

A good modern font might specify special tuning for hundreds of pairs of letters.  So this can be used to fix sentence spacing, right?  Wrong.  Modern fonts almost never define any special pair kern for the period and space.  And the very few that do, define a negative pair kern, that is, they reduce the size of the visual space after the period, making it even smaller than a word space.

To understand why they don't do this, we only have to observe that periods are not simply sentence enders.  They are also used in abbreviations and (perhaps most importantly for this context), in initials.  So for example, J. K. Rowling might well need to be tightened up in the eyes of some, and in this case a negative kern makes sense.  Of course there is no way for the font itself to distinguish this usage with a sentence boundary usage.

[And as much as I love grammatical and typographic holy wars, I'm not going to get into discussions at this time as to whether one should use J.K. Rowling, J. K. Rowling, J K Rowling, or even JK Rowling.  Suffice it to say that on this one, the historical record is all over the map.  Also, let me add that neither J-period-space-K nor J-period-K did a very good job of kerning on my screen just now.]

There are even some fonts that build in extra space to the default width of the period, and then apply pair kerning exceptions for that.  This minority of fonts de facto adds extra space between sentences.  But again, it also adds extra space between initials and after abbreviations, where it isn't needed.  Hopefully fonts that use this method will then add in pair kerning for numbers so that 3.14159265 does not end up with extra space in the middle.  And hopefully letters too so that e.g. the text “e.g.” won't be split open.  This seems like a bad idea, complicating the font, while not actually fixing anything.

When you get down to it, fonts are just data, which is why they really can't do anything.  Modern software though is a different story.  Whether we are talking about page layout or word processing or even the text tools in image software, the editing of text and conversion of unformatted text into formatted text can be pretty spiffy smart.  So maybe when people say that fonts magically fix things, they actually mean that the software is fixing things for you?

Sadly this is not the case.  You can't just “trust the software”.  You have to know what your software is going to do, because there is almost no consistency in handling of sentence spacing in software.  Unix tech-heads that use vi and emacs can benefit from sentence detection based on two spaces between sentences (hooray).  But troff originally could only identify sentences when the terminal punctuation was followed by a carriage return or newline.  More modern gtroff does this, but also uses the two-space habit as a means of sentence detection.  TeX takes the view that EVERY period followed by a space is a sentence boundary, and you have to explicitly find each occurrence that is not a sentence boundary and label it by hand.  Yuck.

But those are all old-school plain text processors that format from plain text to print.  More modern WYSISYG software, like Word for example usually has much worse support.  Word dutifully trusts that all spaces you type are spaces that you mean, and keeps them.  Other editors have taken their cue from the monospacers and only let you type one space.

 In fact, the only consistent software out there is the majority of software that chooses to do absolutely nothing with sentence spacing.  In other words, the majority of software does not fix sentence spacing at all.

If there is any software out there that takes into account the period-space pair kern and attempts intelligent sentence boundary detection and tries to fix spacing of initials, abbreviations, decimal points, and sentence boundaries all in different ways based on all of these factors, I'm not aware of it.

In order for software to “fix” sentence spacing, it has to know what a sentences is.  The best way for that to happen is for users to tell the software what a sentence is.  And as luck has it, we already have a way to communicate this to the software, with two spaces between sentences.  Sadly fonts don't, and can't, have any magic that will do this.  Software can have this magic, but modern software developers generally don't have a clue about real typography.