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#59347: 29.0.50; `:family` face setting ignored Date: Fri, 18 Nov 2022 12:12:29 -0800 Message-ID: <7B856D61-9CA6-4068-A9DB-FAE31258F114@gmail.com> References: <83bkp4bfqf.fsf@gnu.org> <83wn7s9txp.fsf@gnu.org> <83pmdk9pat.fsf@gnu.org> <83k03s9o0z.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="23140"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , 59347@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 18 21:13:15 2022 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 1ow7jf-0005rf-0Y for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Nov 2022 21:13:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ow7jW-0003CN-Bx; Fri, 18 Nov 2022 15:13:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ow7jS-0003C9-VF for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 15:13:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ow7jS-00008W-IU for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 15:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ow7jS-0006T4-Dk for bug-gnu-emacs@gnu.org; Fri, 18 Nov 2022 15:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Nov 2022 20:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59347 X-GNU-PR-Package: emacs Original-Received: via spool by 59347-submit@debbugs.gnu.org id=B59347.166880236324833 (code B ref 59347); Fri, 18 Nov 2022 20:13:02 +0000 Original-Received: (at 59347) by debbugs.gnu.org; 18 Nov 2022 20:12:43 +0000 Original-Received: from localhost ([127.0.0.1]:38381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow7j8-0006ST-EN for submit@debbugs.gnu.org; Fri, 18 Nov 2022 15:12:42 -0500 Original-Received: from mail-pl1-f175.google.com ([209.85.214.175]:44929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow7j4-0006SE-KX for 59347@debbugs.gnu.org; Fri, 18 Nov 2022 15:12:41 -0500 Original-Received: by mail-pl1-f175.google.com with SMTP id g10so5487373plo.11 for <59347@debbugs.gnu.org>; Fri, 18 Nov 2022 12:12:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MVJzObU0TBo6UNLqcJ1lBX9PKkvgNJwb8F8dUbo9hfk=; b=J/s+VXHRc7uAIa0JaGPjNg+XRQBog0Y6Yw91FSrG5U2zZPUV8m9+K8oueKc1+FvpTb fZGQ8IZlKfYJb8I9rC+d3saERzXGlwyRbAj6I4Al/tzPsvWzrxro/dPqcOZyHiWjwdGe no6qjdNbSVoAa1y8+FDuC2U/F/yR9povVjTpKVbUjogSgtFR1RM3QdOFpNJu2hrNwqRf 71dNBB18+nDD5X40adsKVxUDMMJQq2We7cVgYg71ampvVDEYSYFMGfXEWcLEHgj13rDC kLn5zTyY+mqV8IZSNvQ32XLgW5KxkUQVUJbfBiyjMD3U7prdCHHHQOMB4tCfn3lqnZFD MM3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MVJzObU0TBo6UNLqcJ1lBX9PKkvgNJwb8F8dUbo9hfk=; b=zGPGZNI470Cz7mC2xoNXXMMl5gPpS9L+tCuRdyO6ETe8twXrYCTr9mmeaQPSUofqw/ i3N5nckE0dV91cjQxGt06PENKGYEzfFqb9xoaPs5kbQJt2SiabN3g5OAwkSYtf/PVUMJ azM75eMToyYwzJKTSW5aLkbewIdXitEBKNM8TgkUK2W4VD4/sknpCURb81L/K6f122aA 9esE464uhf42m72oQSfDy6dRtWCtjGEEvfPiSSBVXQ5lA0zvn7QvxgSYc6GbMP778pPv h42Pjq89pCj5/fZNkdnrdizmQxTBsI9wnzH/nFF+UxMEkH6Pjgsmf85UHSyuyrC8hMbe Ec2w== X-Gm-Message-State: ANoB5pmSTipScEdTojVGhhp7Re0HU51a747DdkbEIE9FPsw7Z6zwBlie Uw5QfxtVEDGTzql3CJV9DQI= X-Google-Smtp-Source: AA0mqf6gfkcohU6+RvLCNb3TgZhAPVsIdrSUU6DyWQ7B/Uzk9XTfoZ04cPr4QKBqj3BbA5/x+DLUDg== X-Received: by 2002:a17:902:e9c2:b0:187:4920:3a78 with SMTP id 2-20020a170902e9c200b0018749203a78mr1071141plk.88.1668802352718; Fri, 18 Nov 2022 12:12:32 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id x136-20020a62868e000000b00561b53512b0sm3527208pfd.195.2022.11.18.12.12.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Nov 2022 12:12:32 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248277 Archived-At: > On Nov 18, 2022, at 12:00 PM, Yuan Fu wrote: >=20 >=20 >=20 >> On Nov 18, 2022, at 9:21 AM, Eli Zaretskii wrote: >>=20 >>> Cc: 59347@debbugs.gnu.org >>> Date: Fri, 18 Nov 2022 18:54:02 +0200 >>> From: Eli Zaretskii >>>=20 >>>> What should I change in my recipe in order to keep the same default = font >>>> but get the DejaVu Sans that used to get? >>>=20 >>> The default font would be my guess. Try using some other font, not >>> from the fixed-misc family. >>=20 >> I take that back: I tried your recipe, and it works with every font I >> tried except DejaVu Sans. So I guess that font is the culprit, and >> you should find some other font that you like. >>=20 >> Why DejaVu Sans is rejected, I donb't know, but that font has some >> issues that we already discovered in the past, so it could be a good >> idea to get rid of it regardless. >=20 > I might have some more information, and here is a reproduce of what I = see:=20 >=20 > Load these two (open source) fonts in to your machine, and emacs -Q -l = reproduce.el >=20 > The content of reproduce.el is: >=20 > (pop-to-buffer > (let ((font1 "IBM Plex Mono") > (font2 "Charter")) > (with-current-buffer (get-buffer-create "*test*") > (set-face-attribute 'default nil > :font (font-spec :family font1 > :weight 'medium)) > (insert (propertize "Some Text\n" 'face `(:family ,font2))) > (insert (propertize "Some Text" > 'face `(:font ,(font-spec :family font2)))) > (current-buffer)))) >=20 > It inserts two lines of text, both using font2, but the first line = using :family and the second using :font. The one using :family is not = displayed in font2 (it falls back to some other font), but the one using = :font is. >=20 > I think this is because the default font (font1) uses medium weight, = but font2 doesn=E2=80=99t have a medium weight. I tried with different = fonts for font2, and whether that font has a medium weight correlates to = whether the first line of text can be displayed in that font. >=20 > So my guess is that if the face uses the :family attribute, it = inherits the weight from default, and if Emacs cannot find that weight = in that font, it falls back to some other font. >=20 > I don=E2=80=99t know how to =E2=80=9Cfix=E2=80=9D this, but at very = least we should make it easy to figure out why the family attribute = =E2=80=9Cdidn=E2=80=99t work=E2=80=9D. (It=E2=80=99s not unreasonable = for someone to think: I have the font on my machine, the family settings = is set to that font, why is the text not displayed in that font??) >=20 > Personally I think falling back to the same font but different weight = is probably less confusing. >=20 > Yuan >=20 > Basically the culprit in Stefan=E2=80=99s recipe is probably = semicondensed rather than Dejavu. Yuan=