From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#49797: 28.0.50; Setting face to custom fontset doesn't work Date: Tue, 5 Oct 2021 13:51:23 -0700 Message-ID: <1AF30098-F55E-48A7-A0D4-E529DFBA6895@gmail.com> 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> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17589"; mail-complaints-to="usenet@ciao.gmane.io" Cc: handa@gnu.org, 49797@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 05 22:52:16 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 1mXrQ4-0004I4-Nv for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Oct 2021 22:52:12 +0200 Original-Received: from localhost ([::1]:52134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXrQ3-0004Mi-Pa for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Oct 2021 16:52:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXrPu-0004ME-Ka for bug-gnu-emacs@gnu.org; Tue, 05 Oct 2021 16:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXrPu-0003WN-Br for bug-gnu-emacs@gnu.org; Tue, 05 Oct 2021 16:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mXrPu-0002AM-9e for bug-gnu-emacs@gnu.org; Tue, 05 Oct 2021 16:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Oct 2021 20:52:02 +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.16334670968288 (code B ref 49797); Tue, 05 Oct 2021 20:52:02 +0000 Original-Received: (at 49797) by debbugs.gnu.org; 5 Oct 2021 20:51:36 +0000 Original-Received: from localhost ([127.0.0.1]:41976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXrPT-00029c-SV for submit@debbugs.gnu.org; Tue, 05 Oct 2021 16:51:36 -0400 Original-Received: from mail-pj1-f49.google.com ([209.85.216.49]:42935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXrPQ-00029N-LN for 49797@debbugs.gnu.org; Tue, 05 Oct 2021 16:51:35 -0400 Original-Received: by mail-pj1-f49.google.com with SMTP id rm6-20020a17090b3ec600b0019ece2bdd20so631325pjb.1 for <49797@debbugs.gnu.org>; Tue, 05 Oct 2021 13:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Fguf/E0fHp0D0liujcPq7+dP5yFk1/igVyH4Knhtd78=; b=hRZ5pSe+JV5BpeYHsJrm4YBCcSqtGBY60RAnxOCQ3SMfT61pjXDN+z/2zXarN+V39+ Zt+wKbP1O1Nz8cUPpEGGghgDaqA6uT2X1zih3k3BDQAbDMwJOTILXkY19Lq7PF2o4VgS NY6ZUy6oZGHamvR44NcHokKnhE9ItUKYJWtmWrxF1NhLIKHI6NRbJC/dB19adjA2mNOc o8/eUGV47jYW8uBVGd+gZVIRUgg9sYmIdUX9+CPOgOar2uwTDZJW2F/szJjPwoAN5Bwp 2xi5KJx0OM57OlgyxTRWUvi6/9leoZMKXD0zp3JvLHMZ4ErzGiUVjAXKcEQ1/c1/fIE/ mYeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Fguf/E0fHp0D0liujcPq7+dP5yFk1/igVyH4Knhtd78=; b=nkgwqcmeHJWuqMMQNdTfFLJKiCixJWtSEiJyDNf1IyQLWeHL9RATY64A269UJZhzbY g2/5hcs9cpc+blT8EUu8n7e4o/UhjY7YZXdS5lRcBE8UWYhhH+Ym1XDIXbU53sqFtHj1 IYq7H12PMq1J9AQMU/HnW2EkjTX83k3DohH0zlzyW0akGdRbp1VglTDnZDfAx7e705XH 10N3ESIQZRHceLLHLn5nZ6J/N9fxwt/0Mlx4pjH3KCisU+xAAtyw1jkmeu2VuZYWEbwV tkxTuFJTZov308Xumh1oWOGJFa6nUC8UhgIR3R7jEqsHefnzcUWtoqxmBSlt8sA9OrKM LhKA== X-Gm-Message-State: AOAM531FkXwNeQJ6bL3xky3CCUb0kBM3hSDHBYrSRKZC5fw+ZbRA764V 1U16jOjZfJa1RLRxZudzkzA= X-Google-Smtp-Source: ABdhPJyGqMimgeebvE3yBzEYCzXCKGY8dhbeafHJJCRYn7dxfp8olwbURY6eBktAjr3BBweuTh9SuA== X-Received: by 2002:a17:90a:4290:: with SMTP id p16mr6169714pjg.112.1633467085911; Tue, 05 Oct 2021 13:51:25 -0700 (PDT) Original-Received: from smtpclient.apple ([137.110.93.187]) by smtp.gmail.com with ESMTPSA id l18sm19162296pfu.202.2021.10.05.13.51.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Oct 2021 13:51:25 -0700 (PDT) In-Reply-To: <83sfxf2ry5.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.13) 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:216500 Archived-At: > I asked why not use :family and :foundry in the face definition. Did > you try that? :family, :foundry, :font, they all realize into _one_ font. My point is, = to cover all characters might be displayed, the face needs _multiple_ = fonts (therefore I need to use a fontset). Suppose you know Chinese. You want serif CJK and Latin font for = variable-pitch, and sans CJK and Latin font for default.=20 | | CJK | Latin | | variable-pitch | Source Han Serif | Charter | | default | Source Han Sans | SF Mono | How do you make variable-pitch use Source Han Serif for CJK and Charter = for Latin with :family or :foundry attribute? Unless I=E2=80=99m = incredibly ignorant of something, you cannot. That=E2=80=99s why we have = fontsets: it=E2=80=99s basically a mega font composed of multiple fonts = that can use different fonts for different characters. Do we agree on = that? >>> First, Handa-san asked to try a slightly different setting; I'm not >>> sure I understand whether you did and if so, what were the results. = I >>> also don't understand if the analysis of the code above is for the >>> original test case or the one suggested by Handa-san. I'd like to = see >>> the latter. >>=20 >> I have indeed tried and it didn=E2=80=99t work, maybe you missed that = message. Handa-san suggests me to try setting :font attribute rather = than :fontset. The test code uses what he suggests: using :font = attribute. >=20 > And the description what happens with the code is for that second > example, or is it for the first? And the same question about your > proposed fix -- which case does it fix? The description of what happens with the code explains what happens with = both :font and :fontset=E2=80=94both has problems. Problem 1: The following doesn=E2=80=99t work as intended: (set-face-attribute 'variable-pitch nil :font "fontset-serif=E2=80=9D) where =E2=80=9Cfontset-serif=E2=80=9D contains two fonts: Charter for = Latin and Source Han Serif for CJK.=20 The current effect is, Latin characters in =E2=80=98variable-pitch works = (displayed in Charter), CJK characters don=E2=80=99t (not displayed in = Source Han Serif). With my fix, CJK characters work (displayed in Source = Han Serif). Problem 2: =E2=80=98default face cannot use fontset. Even if problem 1 = is fixed, setting the fontset for the default face still doesn=E2=80=99t = display CJK characters correctly. With the fix, setting a fontset for = =E2=80=98default works as intended. The problems are not limited to CJK characters, any other non-ASCII = character that requires a font different from the Latin characters has = the same problem. My fix is based on the assumption that we want to use :font attribute = for both font and fontsets, which is what the manual says, and is what = Handa-san said what RMS wanted. Yuan