From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel@gnu.org
Subject: Re: What is a default font?
Date: Wed, 04 Dec 2019 18:12:39 +0200 [thread overview]
Message-ID: <83tv6ghxxk.fsf@gnu.org> (raw)
In-Reply-To: <4c86b07f-175d-f6cf-171a-b58474ab717a@gmx.at> (message from martin rudalics on Tue, 3 Dec 2019 19:36:41 +0100)
> From: martin rudalics <rudalics@gmx.at>
> 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.
next prev parent reply other threads:[~2019-12-04 16:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-03 18:36 What is a default font? martin rudalics
2019-12-04 16:12 ` Eli Zaretskii [this message]
2019-12-04 18:04 ` martin rudalics
2019-12-04 19:38 ` Štěpán Němec
2019-12-05 7:50 ` martin rudalics
2019-12-05 15:03 ` Eli Zaretskii
2019-12-04 21:21 ` Stefan Monnier
2019-12-05 17:54 ` martin rudalics
2019-12-05 18:04 ` Eli Zaretskii
2019-12-05 18:24 ` martin rudalics
2019-12-05 18:51 ` Eli Zaretskii
2019-12-05 18:59 ` martin rudalics
2019-12-05 19:13 ` Eli Zaretskii
2019-12-06 8:35 ` martin rudalics
2019-12-06 15:14 ` Eli Zaretskii
2019-12-07 9:39 ` martin rudalics
2019-12-07 10:24 ` Eli Zaretskii
2019-12-06 15:45 ` Eli Zaretskii
2019-12-07 9:39 ` martin rudalics
2019-12-07 10:29 ` Eli Zaretskii
2019-12-08 9:03 ` martin rudalics
2019-12-08 15:39 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83tv6ghxxk.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).