GNU bug report logs -
#20022
24.4.90; window-body-height, window-body-width wrong value after text-scale-adjust
Previous Next
Reported by: Vitalie Spinu <spinuvit <at> gmail.com>
Date: Fri, 6 Mar 2015 22:33:02 UTC
Severity: normal
Tags: notabug
Merged with 19194
Found in versions 24.4.50, 24.4.90
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 20022 <at> debbugs.gnu.org (full text, mbox):
> From: Vitalie Spinu <spinuvit <at> gmail.com>
> Date: Sat, 07 Mar 2015 00:31:53 +0200
>
> After text-scale-adjust [C-x C-] window-height and window-width return
> the old (original) value.
As designed: the value is measured in canonical character units.
> The doc says:
>
> This function returns the height, in lines, of the body of window
> WINDOW.
It says much more than that. In particular, it mentions "the
character height of WINDOW's frame", which should be a hint. The
ELisp manual explicitly says "frame's default character height".
> So at least the docs are imprecise or incomplete.
Suggestions to how to make them more complete without confusing users
(who might not even know that the size of the default face's font can
be changed, or that text-scale-adjust exists at all) are welcome.
IOW, there's a problem here: we need to provide a description that
will make sense both to relative newbies and to sophisticated Lisp
programmers alike. The current doc string is an attempt to do so. If
you (or someone else) can suggest a better wording for that, it will
be most welcome.
> 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.
You want default-font-height, I think. (A similar functionality for
width can be used based on font-info modifications on the master
branch only, but you could approximate that by assuming the same ratio
between the canonical width and the rescaled width as between the
canonical height and rescaled height.)
For the line height, don't forget the line-spacing issue, which is
taken into account by the default-line-height function.
(Btw, I'm not sure how you get from window-width/height to
width/height of a character; I suspect that you might be trying to
compute something for which helpful functions already exist, so you
are encouraged to tell more details.)
This bug report was last modified 3 years and 104 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.