“I just chose words carefully”

478 points by zdw 6 hours ago on hackernews | 124 comments

I don’t think anyone particularly enjoys typesetting in monospace.

Regular text is okay – at least as okay as it can be:

Right aligning is also fine, as long as you don’t mind counting spaces, but centering already gets tricky, as you don’t have a half space to make things truly even:

And full justification is where things get particularly weird. The spaces are just too large, and cannot be distributed evenly, creating a really unpleasant feeling:

The solution used in typesetting elsewhere is hyphenation, but in monospace hyphenation also feels unpleasant, with the hyphens drawing too much attention to themselves (and subsequently messing up copy and paste):

This is why you don’t see full justification in text files very often.

But there is one more option. You can rewrite the text to choose only words that precisely add up to the line length to avoid any double spaces.

This is exactly what rs1n did in the late 1990s for his guide to Super Metroid:

It’s astonishing, as it goes like this on for 17,000 more words, each right margin perfectly ending on a letter, no twin spaces in sight.

The author lightly covers in the FAQ at the bottom:

What program did you use to justify the text?

None. I just chose words carefully so that everything lined up on the right hand side. Everything was done with an ASCII editor.

I’m sharing this mostly as a curiosity; some rewrites for physical books are par the course to avoid widows and orphans, but you don’t see them as much in onscreen writing.

At the same time, who among us didn’t nod in recognition at least, having once spent hours massaging a button UI string or a tooltip just to get it to fit under the certain width in a densely packed interface?