all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Hanwen Guo <g.hanwen@outlook.com>
Cc: 68042@debbugs.gnu.org
Subject: bug#68042: 30.0.50; `face-font' returns nil after adding remap relative for fontset
Date: Wed, 27 Dec 2023 15:30:24 +0200	[thread overview]
Message-ID: <83plyr93in.fsf@gnu.org> (raw)
In-Reply-To: <ME3P282MB1505F51FA3B5FB8CC016F612949FA@ME3P282MB1505.AUSP282.PROD.OUTLOOK.COM> (message from Hanwen Guo on Wed, 27 Dec 2023 06:43:46 +0000)

> From: Hanwen Guo <g.hanwen@outlook.com>
> CC: "68042@debbugs.gnu.org" <68042@debbugs.gnu.org>
> Date: Wed, 27 Dec 2023 06:43:46 +0000
> 
> > If you replace all instances of :fontset above with :font, face-font
> will not return nil.
> 
> Actually, if you pass the fontset through the `:font' attribute, only the ASCII font from the fontset is
> used.

Yes, because the faces that are exposed to Lisp are always the faces
used for characters supported by the "ASCII font" of a face.  For
other characters, Emacs creates internally a separate face, which is
not exposed to Lisp, and determines its font from the fontset in
effect, merging the other relevant face attributes to produce a face
as similar as possible to the one used for characters covered by the
"ASCII font".

> This applies to both `set-face-attribute' and `face-remap-add-relative'. AFAIU, I think when it
> comes to the face attributes, the fontset feature is more like a way to set different font for diferent
> character sets, making it able to "display the whole range of characters that Emacs supports" for a
> given face, since setting the `:family' attribute or assigning a single font to `:font' would suffice for
> setting font only for ASCII characters. So the case is, either the `:font' attribute needs to consider the
> full fontset, or the whole fontset feature is, as you said, "obsolete". 

Then please explain in more detail what you are trying to achieve, and
why.  The code snippet you presented makes it hard to guess, since it
defines a face with a special fontset, and then remaps the 'default'
face to that face.  Why would you need to do that, instead of simply
customizing the default-fontset or setting the :fontset attribute of
the 'default' face?

The technical reason for what you see is that face-remapping creates
an anonymous face with the specified attributes, and Emacs doesn't
support the :fontset attribute for anonymous faces.  But since I don't
really understand why you use face-remap-add-relative, I cannot tell
whether this is a problem or how to solve it for your needs.





  reply	other threads:[~2023-12-27 13:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26 11:47 bug#68042: 30.0.50; `face-font' returns nil after adding remap relative for fontset Hanwen Guo
2023-12-26 17:49 ` Eli Zaretskii
2023-12-27  6:43   ` Hanwen Guo
2023-12-27 13:30     ` Eli Zaretskii [this message]
2024-06-09 20:56       ` Stefan Kangas

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83plyr93in.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=68042@debbugs.gnu.org \
    --cc=g.hanwen@outlook.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.