[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is a default font?

From: martin rudalics
Subject: Re: What is a default font?
Date: Wed, 4 Dec 2019 19:04:10 +0100

> 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.

But in that case the first line of the doc-string of

  Return the height in pixels of the current buffer's default face font.

is totally misleading because, as you noted above, asking for such a
value is meaningless when the current buffer is not displayed in the
selected window.  Please try to fix these doc-strings so they tell
what the functions actually do and not how they are used.

I would do that myself but I fail to see where 'face-font' asks about
the font property of a window.  It calls lookup_named_face with the
first argument NULL so that function should "consider only frame-level
face configuration" according to its comment.  Where does it take the
selected window and hence face remapping for that window's buffer into
account?  It's probably all deeply rooted in functions like
merge_face_ref but I'm completely lost there.

In either case, from what you said, the following problem apparently
cannot be resolved: If I have a buffer I want to display via
'display-buffer' with a specified number of lines, that buffer is not
yet displayed anywhere and some face remapping is in effect for that
buffer, I cannot specify how high the window showing that buffer
should be in terms of the remapped font's height.  Is that conclusion

Thanks, martin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]