Subject: Re: bug#20022: 24.4.90; window-body-height, window-body-width wrong value after text-scale-adjust

From: martin rudalics <[email-masked]>
Date: Sat, 07 Mar 2015 10:41:23 +0100

> After text-scale-adjust [C-x C-] window-height and window-width return
 > the old (original) value.

Because it did not change.

 > The doc says:
 >
 >   This function returns the height, in lines, of the body of window
 >   WINDOW.
 >
 > So at least the docs are imprecise or incomplete.

Here the doc also says:

   If WINDOW's pixel height is not an integral multiple of its frame's
   character height, the number of lines occupied by WINDOW is rounded
   internally.  This is done in a way such that, if WINDOW is a parent
   window, the sum of the total heights of all its children internally
   equals the total height of WINDOW.

   If the optional argument ROUND is `ceiling', return the smallest
   integer larger than WINDOW's pixel height divided by the character
   height of WINDOW's frame.  ROUND `floor' means to return the largest
   integer smaller than WINDOW's pixel height divided by the character
   height of WINDOW's frame.  Any other value of ROUND means to return
   the internal total height of WINDOW.

 > Relatedly, there seems to be no way to determine the height/width of a
 > character in pixels after rescaling. `frame-char-width` returns the
 > original size.

Because IIUC the values might differ according to the window where the
character is displayed.  I don't know how to get the value you want.
ISTR that someone is currently working on this.

martin