From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#73752: 29.4; Ligatures are randomly rendered with extra spaces Date: Mon, 28 Oct 2024 21:48:26 +0530 Message-ID: <87wmhs19rh.fsf@gmail.com> References: <86zfn9ycis.fsf@gnu.org> <86o735als7.fsf@gnu.org> <87o73534dn.fsf@gmail.com> <86h68x8nuz.fsf@gnu.org> <86ed418niu.fsf@gnu.org> <87jzds3lay.fsf@gmail.com> <86iktc6zp5.fsf@gnu.org> 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="4600"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: luangruo@yahoo.com, 73752@debbugs.gnu.org, xuan@xlk.me To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 28 17:20:49 2024 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 1t5SU5-0000va-2W for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Oct 2024 17:20:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5STk-0001gH-Nn; Mon, 28 Oct 2024 12:20:28 -0400 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 1t5STi-0001fn-M9 for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2024 12:20:27 -0400 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 1t5STi-0007Et-54 for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2024 12:20:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=URteOtKTpMOBQNKwfQT/0eqFo4hEcNDm2/1offn8LHM=; b=fXcXwLIWIeXByoSheW3k0u9pCesgQv10H5YZtmLW1hwZ7kISfTRQolNgLvLibQMPvqGf/Wcg2370lHQJ9Kyqt54XKHTR35oSzCJD2kKy029HIVUWulAj+YOlDsxNTjwQc8IEGIBpTXV1u3OMcjbYELIbOApnvOUbO3FotKzv7w+W/7dxsSCJq3t2TqGTOndIjxFAO1FDhR9jzOLPJVw43RAkDBidpjr4Fnth+JkbdJjjG7T7Uhy0YQfEfKOxqGt50KyekaKKf79FS0/oKD/IwxnAoDqnKnOdz0uElAD8PdJtVmyFEJ4Y76bOKusdJVBtntdA8emAJgCIo8ZpunIQAg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t5SUI-0008TP-4r for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2024 12:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Oct 2024 16:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73752 X-GNU-PR-Package: emacs Original-Received: via spool by 73752-submit@debbugs.gnu.org id=B73752.173013241832155 (code B ref 73752); Mon, 28 Oct 2024 16:21:02 +0000 Original-Received: (at 73752) by debbugs.gnu.org; 28 Oct 2024 16:20:18 +0000 Original-Received: from localhost ([127.0.0.1]:54500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5STZ-0008MZ-IJ for submit@debbugs.gnu.org; Mon, 28 Oct 2024 12:20:18 -0400 Original-Received: from mail-pl1-f196.google.com ([209.85.214.196]:57674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5STS-0008MG-4Q for 73752@debbugs.gnu.org; Mon, 28 Oct 2024 12:20:15 -0400 Original-Received: by mail-pl1-f196.google.com with SMTP id d9443c01a7336-20b5affde14so31676105ad.3 for <73752@debbugs.gnu.org>; Mon, 28 Oct 2024 09:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730132313; x=1730737113; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=URteOtKTpMOBQNKwfQT/0eqFo4hEcNDm2/1offn8LHM=; b=A/UH4/7jUbF66YwU39Pohh7RpLSKWhyKL4P5+Zh0sIBRKrnbVy6sLK8pjYt25DXtFg ht/SLTUWeHvUhJDKvUXFtUBc9cYtwlPFtOxkV24E/BffA9PjKYqHm6iH6ShUkbx5VpQU AQP7VUbChA45afpYSs8LRR48rUgf7rFwP/Z+ufn95RASmLRsb93/mbaC9h7W+vDkE5Si DCSMjgKQgq0E662K/tJVbvvESDrl/Ufx1m3V9R3vFuXbQwrISgUieT8HEsUWl775qL+P k76ZX2FL5YJcqR1pjGOVSovE8D1naeBT5/mYWSRP+aDZkSTEUK7WDArLimqfvzMNhTvM u9+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730132313; x=1730737113; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=URteOtKTpMOBQNKwfQT/0eqFo4hEcNDm2/1offn8LHM=; b=oEMtieEcVDMOpVxhfKN09EOJq+8eqEf3Nc5PL5HsugBMO33u7h78koGtOtdYp8u4TB IPebMUwSeyZqzmFqkr/r8m3+EELqXKNQdHGN0LJlEqD3/Nm/ibotgilXTjcU32ECxmaP vpswB4cun/+6wBABlECLRkQnUBEbdNKn8zcaC/vPPxBQxmXsrLAJOgnyhIKuIpevEKH5 2a5rLPPbEDaoentFk337r5GeMhzMNVJx9Ati8NS5HCGIp9vCqm0KeCs70nL6CqOVTBzx A5HsqVBR/xt37N4Ugp7gV3gok4jQ4DYD1UnR6pVIaX9JjTmJeFj66aIOLsNG5gl2w0P5 CqMQ== X-Forwarded-Encrypted: i=1; AJvYcCX6x1Eez6WlEv8LrNdY8MFCwYT2wTRBtaG0qyCiyJ0BZEeP5eozdJIYTVFl0BTiUmZkHb5BKg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxfdWrt86lmYmHQdGM18MVpnQrrZK7RFq1UNk4q7sDjvamB62L9 UEPWTBnwPfiheB8D5oxp5zgVr1FVV1tsEw3rNFFhYDvwCHic4OtF X-Google-Smtp-Source: AGHT+IHONFnE9ccVCq1Y+z9gvrocsxHnpG2/5VsPr3VOoi0oicq27Nzk4DXEGhzaQEunhn00eEtHqA== X-Received: by 2002:a17:902:e5c9:b0:20c:7485:892c with SMTP id d9443c01a7336-210c6c344c4mr137709275ad.45.1730132311757; Mon, 28 Oct 2024 09:18:31 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-210bc01344fsm52257705ad.137.2024.10.28.09.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 09:18:31 -0700 (PDT) In-Reply-To: <86iktc6zp5.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 28 Oct 2024 16:59:18 +0200") 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:294438 Archived-At: [=E0=AE=A4=E0=AE=BF=E0=AE=99=E0=AF=8D=E0=AE=95=E0=AE=B3=E0=AF=8D =E0=AE=85= =E0=AE=95=E0=AF=8D=E0=AE=9F=E0=AF=8B=E0=AE=AA=E0=AE=B0=E0=AF=8D 28, 2024] E= li Zaretskii wrote: >> From: Visuwesh >> Cc: luangruo@yahoo.com, 73752@debbugs.gnu.org, xuan@xlk.me >> Date: Mon, 28 Oct 2024 09:56:13 +0530 >>=20 >> Real-life Lisp programs certainly do not change face font attributes so >> often but I believe the script does it so to reproduce the issue >> quickly. In a regular Emacs session, it is enough for the same text to >> be shown in different font sizes (as a consequence of using C-x C-+) and >> font weights to eventually exhibit this misalignment IME. > > You need to catch this situation in some reproducible recipe. Because > up front I don't understand how is this possible: we cache each > composition with its font object, which includes the font size (and > also slant, weight, etc.), so a different variant of the same font > ought to match only cache entries that use the exact same font. Or > maybe I don't understand well enough what > composition_gstring_put_cache does to compute the hash of a > glyph-string header (which is the hash key for a composition)? Is this hash dependent on the font driver? IME and from what I see from other issues in ligature.el's GitHub issue page, the problem seems to be specific to Cairo builds which would also explain why you are not able to reproduce this. Also, do we clear the composition cache when all the GUI frames of an Emacs daemon are deleted? The misalignment goes away when I close all the GUI frames of the daemon, and open a fresh new GUI frame. >> I do not understand the technical details but the width of the glyph >> used to draw it is not the one that should be used for the underlying >> font (weight, size, etc. included) which leads to this misalignment. > > Which seems to indicate that we somehow use a different font's metric. That is my impression, yes. >> To make it more clear, let's say that =3D:=3D is shaped for a font X wit= h a >> specific weight, size, etc. At a later point in time, the width of the >> glyph corresponding to X is used to draw =3D:=3D with font Y of same fam= ily. >> This leads to the observed misalignment AFAIU. > > But how can this happen? Without a reproducible recipe, which can be > reproduced without waiting for too long, it is very hard to > investigate this. I have no idea. This is not easy to reproduce and seems to be heavily dependent on the configuration. Although I use a Cairo build (with Lucid toolkit), the misalignment is not as severe as OP says and it takes a lot more time to reproduce as well. I could never come up with a reproducer that takes less time.