4

Actually, I want to generate a XPM-format image and draw it on the mode line using display attribute of a text string. However, the height of mode line turns to be different as the result of different fontset.

That means I need to know the height of the emacs mode line and use it to generate the corresponding size of the XPM-format image, so that the generated image can fill the mode line totally.

My question is just showing as the title, how can i know the actually (finally rendered) height of the mode line after applying a specific fontset?

I have searched the emacs documentation via apropos, what I found now is:
I can use the font-info function to get the font height in current frame. I guess maybe I can get what I want based on this, although I am unlucky until now.

And, I cannot find any function related a the mode line height.

N.N.
  • 8,336
  • 12
  • 54
  • 94
winterTTr
  • 1,739
  • 1
  • 10
  • 30
  • An ugly way to find it might be to take a screenshot and measure it but then the height might not adjust to different emacs setups. – N.N. Mar 08 '12 at 07:00

1 Answers1

3

Try

(- (elt (window-pixel-edges) 3) 
   (elt (window-inside-pixel-edges) 3))
huaiyuan
  • 26,129
  • 5
  • 57
  • 63
  • Thanks very much, I test use my emacs. And it seems to be the right value. Based on the documentation shows, it seem not always the true. But it really good now for me. – winterTTr Mar 08 '12 at 11:14