简体   繁体   English

如何获得emacs模式行的高度?

[英]How to get the height of the emacs mode line?

Actually, I want to generate a XPM-format image and draw it on the mode line using display attribute of a text string. 实际上,我想生成一个XPM格式的图像,并使用文本字符串的display属性在模式行上绘制它。 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. 这意味着我需要知道emacs模式行的高度,并使用它来生成相应大小的XPM格式图像,以便生成的图像可以完全填充模式行。

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: 我通过apropos搜索了emacs文档,我现在发现的是:
I can use the font-info function to get the font height in current frame. 我可以使用font-info函数来获取当前帧中的字体高度。 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. 并且,我找不到与模式行高相关的任何功能。

Try 尝试

(- (elt (window-pixel-edges) 3) 
   (elt (window-inside-pixel-edges) 3))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM