Skip to content
Prev 359374 / 398503 Next

Typographical error in the documentation of function strwidth?

Peter Dalgaard wrote:

            
Ah, ok, I see now. The "line spacing" is not the line spacing, but the inter-line spacing plus
the height of "M":

"Note that the ?height? of a string is determined only by the number of linefeeds ("\n") it contains: it is the (number of linefeeds - 1) times the line spacing plus the height of "M" in the selected font. For an expression it is the height of the bounding box as computed by plotmath. Thus in both cases it is an estimate of how far above the final baseline the typeset object extends. (It may also extend below the baseline.) The inter-line spacing is controlled by cex, par("lheight") and the ?point size? (but not the actual font in use)"

It's still confusing... Specially since there's no way to get the inter-line spacing except by running

strheight("M\nM") - 2 * strheight("M")

Alberto Monteiro