From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: What is a default font? Date: Wed, 04 Dec 2019 18:12:39 +0200 Message-ID: <83tv6ghxxk.fsf@gnu.org> References: <4c86b07f-175d-f6cf-171a-b58474ab717a@gmx.at> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="70057"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 04 17:29:32 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1icXWt-000I6h-PW for ged-emacs-devel@m.gmane.org; Wed, 04 Dec 2019 17:29:31 +0100 Original-Received: from localhost ([::1]:41078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icXWs-0008SN-3a for ged-emacs-devel@m.gmane.org; Wed, 04 Dec 2019 11:29:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60759) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icXGh-0005XT-Ey for emacs-devel@gnu.org; Wed, 04 Dec 2019 11:12:48 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1icXGg-00058D-NF; Wed, 04 Dec 2019 11:12:46 -0500 Original-Received: from [176.228.60.248] (port=3813 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1icXGg-0004Yy-49; Wed, 04 Dec 2019 11:12:46 -0500 In-reply-to: <4c86b07f-175d-f6cf-171a-b58474ab717a@gmx.at> (message from martin rudalics on Tue, 3 Dec 2019 19:36:41 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243122 Archived-At: > From: martin rudalics > Date: Tue, 3 Dec 2019 19:36:41 +0100 > > I just noticed that my implementation of 'window-default-font-height' > is likely wrong. The fault is all mine but I think that, in a sense, > 'default-font-height', 'default-font-width', 'default-line-height' and > 'face-font' are to blame as well. > > In particular, the 'face-font' doc-string should tell that it returns > a value for the current buffer if FRAME is nil or omitted and a value > for FRAME if it is non-nil, disregarding the current buffer in that > case entirely. If that's the correct interpretation of that function. That is not entirely correct. When called with FRAME nil or omitted, face-font returns the value for the selected frame. > The other functions are IMO ill-specified for the case where the > current buffer does not appear on the selected frame. Using values > returned by 'frame-parameter', 'frame-char-height' and > 'frame-char-width' in that case can be misleading and present simple > guesses at the best. > > Personally, I would prefer two types of functions. One for getting > the default face font of a buffer alone (including remapping) and one > for the default face font of a frame. But I don't know enough about > fonts, their remapping and their relationship to frames to tell what > really makes sense here. I don't think I understand what you need, or why. There's no "face for a buffer"; only face-remapping is buffer-local. frame-char-height take the value from the specified frame, not from a buffer. It is meaningless to ask about a font of a buffer without specifying the frame on which it is, or will be, displayed. You will see that functions which use the likes of default-font-height are interested in the selected window on the selected frame.