emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a built-in way to tell how many lines are in a window in a


From: Eli Zaretskii
Subject: Re: Is there a built-in way to tell how many lines are in a window in a given face?
Date: Mon, 17 Apr 2017 12:05:36 +0300

> From: Zachary Kanfer <address@hidden>
> Date: Sat, 15 Apr 2017 16:27:12 -0400
> Cc: address@hidden
> 
> What I'm doing is making a presentation mode 
> (https://bitbucket.org/zck/zpresent.el;, available on Melpa) that
> presents from Emacs. I want to be able to, for example, make a title slide 
> that looks like this (monospaced
> font required for this to look right):
> 
> +--------------------------------+
> | |
> | |
> | |
> | Title goes here! |
> | |
> | $DATE by $PERSON |
> | |
> | |
> +--------------------------------+
> 
> I'm certainly open to other ways of making this look right. I don't think 
> doing calculations in pixels would work,
> unless there's a way to insert text at a specific pixel inside Emacs. And 
> even if there were, that seems like a
> bunch more work to basically reproduce LaTeX.

Thanks, but I don't think I have a clear understanding how the above
is related to your zck--window-max-lines-per-window.  Let me guess:

Is it correct that you want to calculate how many empty lines to
insert before inserting the Title line, such that the text is
vertically centered in the window?  If so, then I'd begin by inserting
newlines until pos-at-point tells me I'm at the right vertical pixel
coordinate, which can be calculated given the pixel height of the
window and the number of lines you want to be centered in the window
multiplied by what window-font-height returns.  Does this work for
you?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]