I'm making a presentation mode where I want to vertically center some text in the window, which is the only window in the frame. I'm using a custom face so I can control how large the font is.
To horizontally center the text, I can use window-max-chars-per-line
with the face
argument, so I can get the number of characters put in a line.
But I also want to know how many lines are in the window. There's window-body-height
, but that doesn't let me specify a face.
How can I tell how tall a window is in lines of a specific face?
font-info
and(window-body-height nil t)
? – Tobias Apr 12 '17 at 12:28window-font-height
. I'll look into it more and see if I can make it work. Thanks for the pointer towards looking into the font. – zck Apr 12 '17 at 14:53