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#73752: 29.4; Ligatures are randomly rendered with extra spaces Date: Tue, 05 Nov 2024 00:33:17 +0100 Message-ID: <0ac0e3316c0b16e645387450bd48c60b291391eb.camel@timruffing.de> References: <8f02b0490d2abb0889b760fb80c3ec492c63c784.camel@timruffing.de> <86ed3x4h7m.fsf@gnu.org> <86cyjh4dx5.fsf@gnu.org> <68b51105125b6c7a34ec8c2032588ce72d8557bc.camel@timruffing.de> <86wmho38y3.fsf@gnu.org> <861pzu28bz.fsf@gnu.org> <79a634db4f76e482038539722aab18fbf10a9251.camel@timruffing.de> <86msiiync2.fsf@gnu.org> <87bjyxyl64.fsf@gmail.com> <86ses9yh3j.fsf@gnu.org> <8734k9ydb4.fsf@gmail.com> <86ikt5y44p.fsf@gnu.org> <87y121wor7.fsf@gmail.com> <86ed3ty2pe.fsf@gnu.org> <87ttcpwnie.fsf@gmail.com> <86cyjdy1xb.fsf@gnu.org> <87plndwn4z.fsf@gmail.com> <86a5ehy1hc.fsf@gnu.org> <87ldy1wmg9.fsf@gmail.com> <87h68pwm2a.fsf@gmail.com> <868qu1xzhb.fsf@gnu.org> <86y11yuc3x.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="38037"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73752@debbugs.gnu.org, xuan@xlk.me, visuweshm@gmail.com To: Eli Zaretskii , Tim Ruffing , YAMAMOTO Mitsuharu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 05 00:35:18 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 1t86bN-0009j6-IU for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Nov 2024 00:35:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t86bD-00027l-72; Mon, 04 Nov 2024 18:35:07 -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 1t86b8-00025X-IV for bug-gnu-emacs@gnu.org; Mon, 04 Nov 2024 18:35:02 -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 1t86b8-0002tU-3H for bug-gnu-emacs@gnu.org; Mon, 04 Nov 2024 18:35:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=AwPq8wnv6MJmvxrEdeqsRXio3DVv9Azulvc5zX5gcUs=; b=vJ+h12hlIGfcYIsC8WdHuo4loloMY+E4LmCtq3WBjsdvsfkvpz+Snar1uITUvTCNsv8I3Gn8PktB4SFakwUBG+WeUIHfnY22kAm0g6PtCZCwQa9wVi7nje/3rv9hFWTlhRX5WaLYCorG0SMY6ctKZq2r+Ga6xRaON8xtlJr0mCsZyAKINGbiWJ2rgjS5Jfn+KrBwTpTvkZa67HMKB/G6ugzkb0htmScLSg12A3v7r09AsfivXrHHsRx80JxgDmR/CNUSvQOJwGEtO8eghhC7p8oxQj0MtmS4s85J/krQa4L0BfRyg9nOHrvRmZlLi7VPtlbYPHOm5TyFeiHcxf7Z3g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t86b7-0005rc-Nm for bug-gnu-emacs@gnu.org; Mon, 04 Nov 2024 18:35: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: Mon, 04 Nov 2024 23:35:01 +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.173076324422491 (code B ref 73752); Mon, 04 Nov 2024 23:35:01 +0000 Original-Received: (at 73752) by debbugs.gnu.org; 4 Nov 2024 23:34:04 +0000 Original-Received: from localhost ([127.0.0.1]:42873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t86aB-0005qh-PP for submit@debbugs.gnu.org; Mon, 04 Nov 2024 18:34:04 -0500 Original-Received: from mout-p-202.mailbox.org ([80.241.56.172]:45380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t86a7-0005qE-H7 for 73752@debbugs.gnu.org; Mon, 04 Nov 2024 18:34:02 -0500 Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (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 4Xj77g73Gjz9ssZ; Tue, 5 Nov 2024 00:33:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=real-or-random.org; s=MBO0001; t=1730763200; 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; bh=AwPq8wnv6MJmvxrEdeqsRXio3DVv9Azulvc5zX5gcUs=; b=gPKvDgLEPJPH17TOi/Ylt7fiXlhx81hiLvM16H5E89yIGnZfhalBmXwKMHciVZH6wd9eq0 KblLfvroIw6KIgmeKvHyDLuf7zPC0bJTYFSoAnR8fzcsTUbdf8NY0+ko5mmfuNH45YhOTh qssuG2dgb8qINmRy5c6G7nzHDBiAsnLisfG+3GZ3KVXA0rfl07fsG6aPQ/d0XMXeAvC1h2 xdfERkfu1OyOJvkHWuLB2Hc0N551KE5tSu3w1AB8OLkoX1AzQZ/yZHto9lqGqqgZn07t+u UXfjZ6K4qmN7IJ7Q5IwBrgfGsYsFOXBR55+oSz9ZIaBsCXLN315MPK24IZs/tQ== In-Reply-To: <86y11yuc3x.fsf@gnu.org> 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:294891 Archived-At: On Mon, 2024-11-04 at 19:45 +0200, Eli Zaretskii wrote: > > From: Tim Ruffing > > Cc: dev@real-or-random.org, xuan@xlk.me, 73752@debbugs.gnu.org > > Date: Mon, 04 Nov 2024 01:11:39 +0100 > >=20 > > This fixes the problem:=C2=A0=20 >=20 > Thanks.=C2=A0 But do you understand why? >=20 > And how did you arrive to the conclusion that this is the change > which > might help? I was trying to understand why hb_shape_full() gives different results at different times. All the other inputs (e.g., text direction) to hb seemed harmless and fixed for the reproducing script. The only thing that is constantly changing in the script is the font, so this was the obvious candidate. Then I searched harfbuzz's bug tracker for relevant issues, and I found this one, which is rather similar to what we observe (e.g., advance wrong): https://github.com/harfbuzz/harfbuzz/issues/1620=20 > That code was written by a leading HarfBuzz developer, so it's hard > for me to believe that it is so incorrect. >=20 Perhaps it was simply written before harfbuzz implemented caching, so the code was correct for older versions of harfbuzz. The root cause of the aforementioned issue is exactly this. =20 > OTOH, I see that ftcrhbfont is the _only_ HarfBuzz-based font backend > which implements the end_hb_font method, and I think you both told me > that only the Cairo build has this problem?=C2=A0=C2=A0 The Cairo build has this problem, and yeah, I've just checked, I can't reproduce with the the Xft backend.=20 > If so, I think the code > to look at is the end_hb_font method and what it does to the hb_font > object.=C2=A0 The end_hb_font method is called each time the shaper is > called, so whatever it does to the hb_font object is inherited by the > next call to the shaper. This sounds like a plausible cause, but as far as I can tell, end_hb_font doesn't do anything to hb_font. The end function is simply necessary to call cairo_ft_scaled_font_unlock_face(). What I don't understand is whether or how the underlying FT_Face or FT_Size is supposed to change at all. I assume it's not supposed to change?