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#67810: 29.1; fonts use synthetic bold on Linux / pgtk Date: Wed, 13 Dec 2023 14:39:36 +0200 Message-ID: <83le9ys2d3.fsf@gnu.org> References: <0719018bb386e840efaa655b7c0b765ece9cd9ff.camel@timruffing.de> 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="5242"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67810@debbugs.gnu.org To: Tim Ruffing Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 13 13:41:05 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 1rDOXx-00018r-1X for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Dec 2023 13:41:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDOXj-00048T-PY; Wed, 13 Dec 2023 07:40:53 -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 1rDOXf-00047m-7Q for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 07:40:48 -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 1rDOXe-0003yx-MY for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 07:40:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rDOXu-0004pW-Bb for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 07:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Dec 2023 12:41:02 +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.170247120718492 (code B ref 67810); Wed, 13 Dec 2023 12:41:02 +0000 Original-Received: (at 67810) by debbugs.gnu.org; 13 Dec 2023 12:40:07 +0000 Original-Received: from localhost ([127.0.0.1]:58376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDOX1-0004oC-3S for submit@debbugs.gnu.org; Wed, 13 Dec 2023 07:40:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDOWy-0004nd-7X for 67810@debbugs.gnu.org; Wed, 13 Dec 2023 07:40:06 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rDOWb-0003gl-KD; Wed, 13 Dec 2023 07:39:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=wQMpvIYEC3XQgORtsXSxeu4COvxw+77Q74X3nMZBSdY=; b=Q1jWXvJNjqHCj8QzoaCc Ke4dG5EQHCLpBlVz+ijUH5+CQDglsvSFX9rhBTn8sx6ieMUaxdpQt1x2jDd5sFQAbZEL7x4cc6ggy f9q5sbCqUIIimBzGKuAQ2nRWi3oPDfVHsM+sqT3hjwQX0uL7PFgKToktVtheWRPt9Qholk3Kn81m4 sxdML4wpGQgrQanf59CiLGZeqEJSrImAsdvjMD8mLqCOxGBk8xKEunXKKZNgQ9vz6yf9VgoJ9ls4m WX4EPdMn4P9Qbh9uIvfvqaju0O9JI/lEolk8V3fEFqSCC09NpOP3G4VPqCG4TPg+Zyx7aag5pzXac /641hE54ntSsDw==; In-Reply-To: <0719018bb386e840efaa655b7c0b765ece9cd9ff.camel@timruffing.de> (message from Tim Ruffing on Wed, 13 Dec 2023 13:03:47 +0100) 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:276124 Archived-At: > From: Tim Ruffing > Date: Wed, 13 Dec 2023 13:03:47 +0100 > > To reproduce: > 1. `emacs` -Q on Linux with pgtk enabled > 2. `M-x select-frame-font` and select a font that doesn't have a > bold weight > 3. Observe that the buffer indicator (`*scratch*`) in the status > line is in bold (using synthetic bold glyphs) > > This is annoying in combination with symbol fonts such as Nerd fonts. > The bold versions of some symbols look strange, and worse, they may be > too wide to fit two glyphs and are clipped then. > > What I have tried: > * I thought this is a font-config thing. /etc/fonts/conf.d by default > has a symlink 90-synthetic.conf that sets the "embolden" attribute > for font queries that ask for a bold font but only regular is > available. Removing that symlink does make a difference when I try > `fc-match "MY-FONT:weight=bold" --verbose | grep bold`. With the > symlink, fc sets the embolden attribute, and without the symlink, it > doesn't. I can even see the difference in emacs' (Pango) font > selection dialog. But emacs itself doesn't seem to care about this > and still creates a synthesized bold font.  > * Cairo is supposed to pick this attribute up [1] and act accordingly, > but that doesn't work. I tried to add a printf("synthesize: %d\n", > cairo_ft_font_face_get_synthesize(font_face)); to the current emacs > git (75fd7550ed6cede6c9e8224f1f2d62637c43fdd4) in ftcrfont_open, and > this always prints "0" (even with the symlink in place!). AFAIU this > means that Cairo should never embolden fonts, but some reason > there's something in emacs that does it.   > * describe-font only shows the medium/regular variant.   Thanks, but why do you think this is an issue for Emacs to solve? I don't think Emacs creates such "synthesized" fonts; are you sure it does? I think Emacs just asks fontconfig for a bold font; it has no knowledge whether it gets a real or a synthetic font.