Subject: Re: bug#46853: Confusing terminology "face height" instead of "font size"

From: Eli Zaretskii <[email-masked]>
Date: Thu, 04 Mar 2021 15:46:08 +0200

> From: Stefan Kangas <[email-masked]>
> Date: Wed, 3 Mar 2021 18:16:02 -0600
> Cc: [email-masked]
> 
> >> and then `C-x C-+' in the buffer enlarges all the faces, even
> >> variable-pitch...
> >
> > It only enlarges those faces which inherit their size from 'default'.
> 
> I find the semantics here confusing.  I do this in emacs -Q:
> 
>     (progn
>       (defface foo-bar '((t :weight bold)) "foo")
>       (pop-to-buffer (get-buffer-create "foo"))
>       (insert "aaa " (propertize "bbb" 'face 'foo-bar) " ccc")
>       (text-scale-adjust 3))
> 
> And I see that "bbb" has its font size increased together with "aaa" and
> "ccc".  But `M-x describe-face RET foo-bar' says that "Inherit:
> unspecified".

All the faces implicitly inherit from 'default'.

> Looking at the manual, the node `(elisp) Basic Faces' says:
> 
>     ‘default’
>          The default face, whose attributes are all specified.  All other
>          faces implicitly inherit from it: any unspecified attribute
>          defaults to the attribute on this face (*note Face Attributes::).

Exactly.

> So when you say that "it only enlarges those faces which inherit their
> size from 'default'", doesn't that just mean that *any* face is resized,
> unless that face itself or any its parents specify an absolute :height
> (an integer)?

No, it doesn't have to be an absolute :height attribute.  It can also
be:

  . a face that inherits from a face other than 'default', which has
    an absolute :height attribute
  . a face that specifies a relative :height attribute and inherits
    from a face other than 'default that specifies an absolute :height
  . any other situation where a face recursively inherits from some
    other face with a non-default absolute :height