From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#49797: 28.0.50; Setting face to custom fontset doesn't work Date: Wed, 06 Oct 2021 22:02:51 +0300 Message-ID: <83y2760yec.fsf@gnu.org> References: <87y29k2h4z.fsf@gnu.org> <3B853424-9F63-4A6B-B7A9-2E3AB71986AC@gmail.com> <835yub4fj5.fsf@gnu.org> <8FD18262-3F40-4033-A49D-F6CEA89A3A31@gmail.com> <83sfxf2ry5.fsf@gnu.org> <1AF30098-F55E-48A7-A0D4-E529DFBA6895@gmail.com> <838rz62kx8.fsf@gnu.org> <890ABB11-65A7-4F52-8816-7FA90BED7961@gmail.com> <83zgrm0zqt.fsf@gnu.org> <219B3DA8-2E40-4BC1-8235-7330308F1737@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28400"; mail-complaints-to="usenet@ciao.gmane.io" Cc: handa@gnu.org, 49797@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 06 21:04:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYCDC-00078j-4Q for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Oct 2021 21:04:18 +0200 Original-Received: from localhost ([::1]:45690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYCDA-0000Ez-Uj for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Oct 2021 15:04:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYCCy-0000E5-O8 for bug-gnu-emacs@gnu.org; Wed, 06 Oct 2021 15:04:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33963) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mYCCw-0008Vq-GP for bug-gnu-emacs@gnu.org; Wed, 06 Oct 2021 15:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mYCCw-0002ck-0P for bug-gnu-emacs@gnu.org; Wed, 06 Oct 2021 15:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Oct 2021 19:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49797 X-GNU-PR-Package: emacs Original-Received: via spool by 49797-submit@debbugs.gnu.org id=B49797.163354701610048 (code B ref 49797); Wed, 06 Oct 2021 19:04:01 +0000 Original-Received: (at 49797) by debbugs.gnu.org; 6 Oct 2021 19:03:36 +0000 Original-Received: from localhost ([127.0.0.1]:45509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYCCU-0002bx-EY for submit@debbugs.gnu.org; Wed, 06 Oct 2021 15:03:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYCCF-0002bW-0D for 49797@debbugs.gnu.org; Wed, 06 Oct 2021 15:03:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37770) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYCC8-0007tr-Ga; Wed, 06 Oct 2021 15:03:13 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2315 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYCBu-0008Rz-Nw; Wed, 06 Oct 2021 15:03:10 -0400 In-Reply-To: <219B3DA8-2E40-4BC1-8235-7330308F1737@gmail.com> (message from Yuan Fu on Wed, 6 Oct 2021 11:56:18 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:216585 Archived-At: > From: Yuan Fu > Date: Wed, 6 Oct 2021 11:56:18 -0700 > Cc: Kenichi Handa , > 49797@debbugs.gnu.org > > >> fontset = FONTSET_FROM_ID (face->fontset); > >> > >> Then find an appropriate font from it > >> > >> rfont_def = fontset_font (fontset, c, face, id); > > > > Yes, AFAIU that's the part where we check if the current face's > > fontset's font, made for the ASCII characters, happens to have a glyph > > for the non-ASCII character we need to display. > > That is not, the part you mentioned is before: > > if (face->ascii_face->font) > { > XSETFONT (font_object, face->ascii_face->font); > if (font_has_char (f, font_object, c)) > return face->ascii_face->id; > } No, this is where we try to use the ASCII font for symbols and punctuation characters. > And what about the comment I mentioned? Did you read it? Yes, but it has no relevance to the issue at hand. That whole part is about displaying symbol and punctuation characters. > In any case, > > rfont_def = fontset_font (fontset, c, face, id); > > finds a font in the fontset that can display character c. That’s hard to ignore. I didn't. > > As mentioned earlier, user code is not supposed to set the :fontset > > attribute directly, which is why it isn't documented. > > Finternal_set_lisp_face_attribute has code that let me set :fontset. Why is it there if Lisp is not supposed to set :fontset? How is that relevant? That something is possible doesn't mean it's recommended. > Plus, Emacs doesn’t set :fontset by itself It does, via the Lisp attributes and LFACE_FONTSET_INDEX. That's what matters on the C level.