Tag

widows

What’s Wrong with these Pictures?

Someone, or a group of someones, in the WordPress community decided to take it upon himself (herself?) to prevent “widows” in post titles (and perhaps eleswhere too — but I’ve just noticed it here). A widow, sometimes called an orphan, is the last word of a paragraph that sits by itself on its own line, as, happens sometimes. Typically it stands out and looks bad when the width of the text block is quite wide compared to the width of the widowed word. But it doesn’t look bad on a narrow column of text, because the widow just doesn’t stand out that much compared to the full column width.

WordPress automatically applies an anti-widow solution of adding a non-breaking HTML space (&nbsp) between the last two words of a post title, no matter how long the words are or whether there will be a widow problem. It basically means the last two words of the title will be treated as one long word. So it creates stupid looking headlines like these two (images above from this website). In the first case, the last two words “information center” are forced to stay together on the last line, creating an awkward gap in the middle line. In the second case, the two words concatenated together are too long for the column width, so the last three letters are forced onto a third line, with no regards for proper hyphenation.

Why has no one developed a better solution for this? Is it because all programmers are aesthetically blind? Certainly InDesign, the Adobe page layout software, does not make such a dumb, kludgy fix, so there is a way to work it out mathematically. The correct approach would use some combination of running words through a dictionary to find proper hyphenation break points, comparing the width of the words for each line to the available column width, and deciding whether to hyphenate or move a word to the next line. There ought to be user options to turn hyphenation on or off or to “balance ragged lines,” as there is in InDesign.

Is this too much to ask? Is the fix already out there? Am I missing something in WordPress? I am using WordPress.com, so I cannot install a plugin that might fix it; nor can I edit the PHP.