in reply to Text width metrics/heuristics

This may sound like an off-topic answer, but wouldn't that be the job of some CSS declaration? Some combination of overflow and white-space could be the answer to your problem.

Just a thought...