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: Wed, 13 Dec 2023 13:03:47 +0100 Message-ID: <0719018bb386e840efaa655b7c0b765ece9cd9ff.camel@timruffing.de> 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="23627"; mail-complaints-to="usenet@ciao.gmane.io" To: 67810@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 13 13:05:11 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 1rDNzD-0005oS-5K for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Dec 2023 13:05:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDNz2-0007J4-74; Wed, 13 Dec 2023 07:05:02 -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 1rDNyp-0007I4-3Q for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 07:04: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 1rDNyn-0005gy-RR for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 07:04:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rDNz3-0001La-Nr for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 07:05: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: Wed, 13 Dec 2023 12:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67810 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17024690765133 (code B ref -1); Wed, 13 Dec 2023 12:05:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Dec 2023 12:04:36 +0000 Original-Received: from localhost ([127.0.0.1]:58348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDNyd-0001Ki-PR for submit@debbugs.gnu.org; Wed, 13 Dec 2023 07:04:36 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:50258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDNyb-0001KU-KK for submit@debbugs.gnu.org; Wed, 13 Dec 2023 07:04:34 -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 1rDNyF-00072O-DF for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 07:04:11 -0500 Original-Received: from mout-p-202.mailbox.org ([80.241.56.172]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1rDNyC-0004WE-Nn for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 07:04:11 -0500 Original-Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (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-202.mailbox.org (Postfix) with ESMTPS id 4SqvK02kpQz9t00 for ; Wed, 13 Dec 2023 13:03:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timruffing.de; s=MBO0001; t=1702469028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:autocrypt:autocrypt; bh=rm8m83wcetM1GCak3xWE6vFiX6sWbGvQtUEUYz0ZM+o=; b=IETtHdLKcDQM0fgik8+hdc4mPZSXkczjtBNQWYh2HrDztfE8zuL93qxPGb2lEBRKrvIrd4 dpkaNNXfgKJVcTbNUajVYnoHrhVmfaIekdIvWQiQiyiExsmBiRHqMl8XS5DEgNlbIhHvtO lBnUP4xg8KGMlmTLnNEW8GnC9VnXQ55+P3s8ok/gmDp5SZU/u6GmNOShc7o9Bt1nw84thj ouJIu0TtlD+9hPHfwx8ASnS1+5S3QgCTsUqRxq6yUDN0DiawzS+xWSxaTrDYXreqoJVYLl kk5GzpG21ZwwH3E126rwYZwV6NKKSX1grN7MoBDGoKAK/gSm/R00UtYn2YDZTQ== 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/ Received-SPF: pass client-ip=80.241.56.172; envelope-from=crypto@timruffing.de; helo=mout-p-202.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:276121 Archived-At: 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=3Dbold" --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.=C2=A0 * 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. =C2=A0 * describe-font only shows the medium/regular variant. =C2=A0 [1] https://gitlab.freedesktop.org/cairo/cairo/-/blob/master/src/cairo-ft-font.= c#L1928-1936 In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) System Description: Arch Linux Configured using: 'configure --with-pgtk --with-native-compilation=3Daot --sysconfdir=3D/etc --prefix=3D/usr --libexecdir=3D/usr/lib --with-tree-sitter --localstatedir=3D/var --with-cairo --disable-build-details --with-harfbuzz --with-libsystemd --with-modules 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3D2 -Wformat -Werror=3Dformat-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=3D/build/emacs/src=3D/usr/src/debug/emacs -flto=3Dauto' 'LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=3Dauto' 'CXXFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fno-plt -fexception= s -Wp,-D_FORTIFY_SOURCE=3D2 -Wformat -Werror=3Dformat-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=3D/build/emacs/src=3D/usr/src/debug/emacs -flto=3Dauto'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $LC_COLLATE: de_DE.UTF-8 value of $LC_CTYPE: de_DE.UTF-8 value of $LC_MESSAGES: en_DK.UTF-8 value of $LC_MONETARY: de_DE.UTF-8 value of $LC_NUMERIC: de_DE.UTF-8 value of $LC_TIME: en_DK.UTF-8 value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl- loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 77248 5503) (symbols 48 7107 0) (strings 32 19670 2185) (string-bytes 1 602889) (vectors 16 15723) (vector-slots 8 329133 12738) (floats 8 27 46) (intervals 56 270 0) (buffers 984 12)