January 9, 2013

Word In A Box

Graphic design and typography friends: What is the best way to vertically align a word in a box?

Word In A Box

You could say, “put the baseline in the center of the box.” Or, you might say, “center the bounding rectangle of the word.” Perhaps you’ll say something like “Set the baseline half the x-height below the centerline,” which would make me cry. But perhaps that’s the answer. (As you can tell, I’m deep into Tinderbox Six design, and there have been tears aplenty and there will be more. Bring it on.)

But what if the text is all caps? Then everything is above the center, and the bottom half is empty. Here, we have nine characters but only two descenders; do the rare descenders balance the ascenders?

Constraints: the solution has to be computational, and should ideally apply reasonably to arbitrary text and arbitrary fonts. Email me.