From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Ruffing Newsgroups: gmane.emacs.bugs Subject: bug#67810: 29.1; fonts use synthetic bold on Linux / pgtk Date: Thu, 14 Dec 2023 16:06:32 +0100 Message-ID: <723b91276f83652bc6867f95630e1057c05ffb26.camel@timruffing.de> References: <0719018bb386e840efaa655b7c0b765ece9cd9ff.camel@timruffing.de> <83le9ys2d3.fsf@gnu.org> <3ebaf489f6dad748258c7fb01d3200b674ebb1f1.camel@timruffing.de> <83h6kmrzkz.fsf@gnu.org> <7ea3f7db448191f2b9886604084abe84d0caaf61.camel@timruffing.de> <83y1dxqm46.fsf@gnu.org> <83le9xqewb.fsf@gnu.org> <87h6klja8c.fsf@yahoo.com> Mime-Version: 1.0 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="5272"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67810@debbugs.gnu.org To: Po Lu , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 14 16:07:19 2023 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 1rDnJ0-00017X-Mk for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Dec 2023 16:07:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDnIo-00079W-D3; Thu, 14 Dec 2023 10:07: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 1rDnIm-00079G-Gj for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 10:07:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rDnIk-0002r3-Lj for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 10:07:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rDnIj-0000Ut-Lc for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 10:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tim Ruffing Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Dec 2023 15:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67810 X-GNU-PR-Package: emacs Original-Received: via spool by 67810-submit@debbugs.gnu.org id=B67810.17025664031886 (code B ref 67810); Thu, 14 Dec 2023 15:07:01 +0000 Original-Received: (at 67810) by debbugs.gnu.org; 14 Dec 2023 15:06:43 +0000 Original-Received: from localhost ([127.0.0.1]:50751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDnIQ-0000UL-Md for submit@debbugs.gnu.org; Thu, 14 Dec 2023 10:06:43 -0500 Original-Received: from mout-p-102.mailbox.org ([80.241.56.152]:43434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDnIO-0000U7-TH for 67810@debbugs.gnu.org; Thu, 14 Dec 2023 10:06:41 -0500 Original-Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4SrbKP6TJyz9sXk; Thu, 14 Dec 2023 16:06:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timruffing.de; s=MBO0001; t=1702566393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=sMPGXaOwKoenaPVwAlcB8i2TFHkiadhNWNfdBvd7aLA=; b=yM6dR6uJ9X6D4G3aH4nRun/wqJUwRPAjvnJdOwICC0vP/dzC+0x++Yxl3yq0wGsEnAsMSM 4EhJKpauT+JBzJqkCG897ms+ve0LnBltWaK6BgY+IKyaC27pe6bP69grCwFRW8SI8Pp2k9 kLxh20R1l+vtwCdN+WryDJcEHXD0DWA+x22K8uQdzx2xyJsfLyf9wjhidaj6VlTqkrcjzC UlcGjt8ASysLsk/a1Ve/dWOsivxpwcHKUnLU04WTeLtHpc4N+zbaY+dk0P43X8QIno8FsE LPKxEurXQYOWq3EwbNSuX+q1VgjykQ5X/V4gZDGXaFMwPcgw0npnnIBgmHWHWQ== In-Reply-To: <87h6klja8c.fsf@yahoo.com> Autocrypt: addr=crypto@timruffing.de; prefer-encrypt=mutual; keydata=mQINBFz4LCMBEADLgtVg3uT+kybmXDPpXMvd8KBhTfAL5DP6umC9hkv/WHnfbCOUujhyvBljckcExAFr7tDYSgIjqa0L32SCT0NEaeY/s3WOYIacjBIEjTrgt01401lOWoX3XeYTWOlVUmUg+4iJPmBSPaj2bJR9Sq6NZhQjQ8K24VMtUNMiDeIIcstLkvQ4ZWkSuBUQJrJ0gUCZcUHNEyyGyZj1HOVGqGK7hTIiT1TfAgYKDDzk955LzgxbmATJWQLD7AGUIjKf/s418PTxI7Hh5ptH+Rq30+wkfvzJumYgkWUzeV6jzlOST5LkrFWQTfCXNvFNxSI9FVKjDIJZ7nQlgd+qNpGop90S3UqA8ofoG9liJm/jmbgIfJTgIiJpulycJD90PyJiWxtGshuZnHjCpkmU5vc1ZbuYyzH2wLoABSBsjy3Tb/25W2mnYnsOcVo1sWOGl+08Lb63ocVYGY27OrAIsv35pS/gMSGcJVg/EmPIM4+PmjeOxDlrJEW+8YzjKV9XtDv6VcBT1/OcA64knWC7JAGf0CGRodpolDjyfFRLOPV2/UbyOMJZjkxKTtV0je/RiMTupIHWcmimkvzpNo8D8U+Ac7KTPuPBrbj8EWeTbd/sK6bncjPL2DLomov0gCg/qlgObYmZ834+tQcThIBi3cj1cRj/0yKPy1uHgk2P2jO5i9AXGQARAQABtB9UaW0gUnVmZmluZyA8dGltQHRpbXJ1ZmZpbmcuZGU+iQJXBBMBCABBAhsBBQsJCAcCBhUKCQgLAgQWAgMBAh4 BAheAAhkBFiEECeA/hxCS5A4QbpArM7yGq4D/ 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:276194 Archived-At: On Thu, 2023-12-14 at 13:19 +0200, Eli Zaretskii wrote: > One can always insert an icon with the likes of >=20 > (propertize "ICON" 'face '(:weight medium)) Sure, but do you think that's a proper solution to add this whenever buffer contents change? What if the user visits a file with an icon? I don't know enough about the internals of emacs, but this still seems the wrong approach to me? =20 On Thu, 2023-12-14 at 19:26 +0800, Po Lu wrote: > The only existing variable which controls font display through > matching > fonts against a regexp has been effectively abandoned over the years, > and is nonfunctional on all systems besides X and Android. > (Grep for Vvertical_centering_font_regexp: only sfntfont.c and > xfont.c > consult it.) >=20 > A compelling reason for us _not_ to introduce more such variables, as > they will soon fall into disuse and neglect. >=20 >=20 Makes sense. But then I suspect a boolean toggle is equally bad, as it would equally fall into disuse. > Yes, and don't these packages require using their own specialized > icon fonts to begin with? Yes, packages like all-the-icons and nerd-icons do require specialized. fonts. But I'm not sure what this implies. What do you suggest that these packages do? I mean, a crude hack is to make emacs believe that the specialized fonts are already bold. But even this is not too easy. AFAIU, this cannot be done in elisp (because font objects are not modifiable), so the packages can't do this emacs. What one can always do is to distribute patched font files. I could install a patched font of the icon font that claims it's bold. But that's also a rather crude hack. But thanks to your explanation, I managed to come up with a different workaround. The following effectively makes emacs believe that the fonts are bold without the need to patch a font Symbols Nerd Font bold That's still a bit crude due to the way emacs uses fontconfig. AFAIU the way fontconfig typically is supposed to handle this is via target=3D"font" or target=3D"match", i.e., the font is correctly parsed into fontconfig's database but only when applications *query* for the font, config tweaks apply and applications get a modified view, e.g., with weight=3Dbold in this case.=C2=A0 But this snippet here with target=3D"scan" actually modifies the entry in the fontconfig database because this is the only thing that works with emacs. This is probably the same these two bugs: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25147=20 https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D17792 .