From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#19194: 24.4.50; `window-body-width' is not dynamic relative to font size changes Date: Fri, 28 Nov 2014 08:29:05 +0100 Message-ID: <54782441.3030600@gmx.at> References: <87h9xm6plp.fsf@gmail.com> <5476F298.5000205@gmx.at> <87ppc8rk08.fsf@gmail.com> <54776EED.9090303@gmx.at> <83y4qwmq66.fsf@gnu.org> <54778275.1090007@gmx.at> <83tx1kml24.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1417159835 17720 80.91.229.3 (28 Nov 2014 07:30:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Nov 2014 07:30:35 +0000 (UTC) Cc: holtzermann17@gmail.com, 19194@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 28 08:30:28 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XuG0Z-0000Cb-Cu for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Nov 2014 08:30:27 +0100 Original-Received: from localhost ([::1]:42835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuG0Y-0007tj-UD for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Nov 2014 02:30:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuG0O-0007jz-A7 for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 02:30:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuG0D-0002fi-5T for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 02:30:16 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuG0D-0002fZ-3G for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 02:30:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XuG0C-0006To-LU for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 02:30:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Nov 2014 07:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19194 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19194-submit@debbugs.gnu.org id=B19194.141715976024806 (code B ref 19194); Fri, 28 Nov 2014 07:30:04 +0000 Original-Received: (at 19194) by debbugs.gnu.org; 28 Nov 2014 07:29:20 +0000 Original-Received: from localhost ([127.0.0.1]:48080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XuFzU-0006S2-5p for submit@debbugs.gnu.org; Fri, 28 Nov 2014 02:29:20 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:50171) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XuFzR-0006Rs-DZ for 19194@debbugs.gnu.org; Fri, 28 Nov 2014 02:29:17 -0500 Original-Received: from [88.117.48.182] ([88.117.48.182]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0LcWSI-1YMPHQ2Lp8-00ju83; Fri, 28 Nov 2014 08:29:14 +0100 In-Reply-To: <83tx1kml24.fsf@gnu.org> X-Provags-ID: V03:K0:rTzC76+PhvgIADM8VcFldJ4/QPUr2rZEyVE6DU+V3m/Adb944Yh riPtIljN9woH91XvRDanVMDH3JNP4pV43BMPMP1vN0KeBJwAjKtT+ic6s8a5QXYdQgxuTnO Yhc79ZiaFgI+IaUxJ6FmBNMuxmxbnS6+mx3riSdlqH8oxWmHtmfQ77IBZTspeJ/8oUdY+/f yhylcauoH1YhaKjAEIW9Q== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96693 Archived-At: > Faces are frame-specific. The same face can have different attributes > on each frame, and that includes the size. That's what I'm trying to fathom out here all the time. So when calculating the actual height of a character as it will be displayed in a window I have to apply (in some order) the height attribute specified by (1) the font of the frame the window belongs to, (2) the font of the buffer shown in the window, and (3) the font of the default face. >> > You mean, like what default-font-height returns? >> >> Does this take text scaling into account? > > Yes. You can try it yourself: call it before and after "C-x C-+", and > see for yourself. I did now. >> Is this the final value as it would be displayed or could the height >> of "the font of the frame's 'default' face" get mixed in afterwards? > > The former, I think. OK. Now how do I get the `default-font-width' from that? >> And how does `default-font-height' differ from >> `default-line-height'? > > default-line-height includes the line-spacing. I see. Silly of me to ask. The doc-string of this should be slightly improved because OT1H `line-spacing' is buffer-local and OTOH "the frame" in The value includes `line-spacing', if any, defined for the buffer or the frame. is slightly ambiguous. >> > Btw, the OP wanted the width of the window, not its height, AFAIR. >> >> ... we would need `window-screen-columns' too. > > That will be harder, unless we change some APIs. We currently don't > have the font width in what font-info returns. Is there a way to approximate the "width of a character" in points from (1) its height and (2) its width attribute? martin