From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii 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 10:49:36 +0200 Message-ID: <83h9xjn1zz.fsf@gnu.org> 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> <54782441.3030600@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1417164626 24770 80.91.229.3 (28 Nov 2014 08:50:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Nov 2014 08:50:26 +0000 (UTC) Cc: holtzermann17@gmail.com, 19194@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 28 09:50:18 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 1XuHFp-0006jB-B9 for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Nov 2014 09:50:17 +0100 Original-Received: from localhost ([::1]:43078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuHFo-0007e9-Vk for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Nov 2014 03:50:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuHFf-0007bq-R9 for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 03:50:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuHFa-0001UU-Ly for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 03:50:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuHFa-0001Ti-I4 for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 03:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XuHFa-0008WT-2E for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 03:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Nov 2014 08:50:02 +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.141716458232727 (code B ref 19194); Fri, 28 Nov 2014 08:50:02 +0000 Original-Received: (at 19194) by debbugs.gnu.org; 28 Nov 2014 08:49:42 +0000 Original-Received: from localhost ([127.0.0.1]:48098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XuHFF-0008Vm-Ex for submit@debbugs.gnu.org; Fri, 28 Nov 2014 03:49:41 -0500 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:53392) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XuHFC-0008Va-7k for 19194@debbugs.gnu.org; Fri, 28 Nov 2014 03:49:39 -0500 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NFQ00N00QQGO400@mtaout29.012.net.il> for 19194@debbugs.gnu.org; Fri, 28 Nov 2014 10:47:33 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFQ00G2LR39TL80@mtaout29.012.net.il>; Fri, 28 Nov 2014 10:47:33 +0200 (IST) In-reply-to: <54782441.3030600@gmx.at> X-012-Sender: halo1@inter.net.il 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:96697 Archived-At: > Date: Fri, 28 Nov 2014 08:29:05 +0100 > From: martin rudalics > CC: holtzermann17@gmail.com, 19194@debbugs.gnu.org > > > 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. We always use the current default face's font for this. Otherwise, you get to a problem that IMO is insoluble even in principle. > >> 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? You need help from Emacs, because it knows everything about that font's metrics. But we don't have an API for that for now. > > 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. It's ambiguous on purpose: the line-spacing can be specified in several ways. Feel free to improve the doc string. > >> > 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? There's no need: the width of a font is well defined, and the display engine uses it all the time. We just don't expose it in the font-info API; we should add that.