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: Wed, 06 Nov 2024 20:20:03 +0530 Message-ID: <87ldxwv2lg.fsf@gmail.com> References: <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="6370"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Tim Ruffing , xuan@xlk.me, YAMAMOTO Mitsuharu , 73752@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 06 15:52:29 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 1t8hOX-0001QR-1Y for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Nov 2024 15:52:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8hOA-0006Ue-Tr; Wed, 06 Nov 2024 09:52: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 1t8hO7-0006UE-Mm for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 09:52: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 1t8hO6-000810-Oh for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 09:52:03 -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:Date:References:In-Reply-To:From:To:Subject; bh=Kt2KbOLnvD81hDYA/BMxdojYq7q9+E2AsglntzmIYTM=; b=O7uQPnXosdznVYdSydZykKyIa+butc84pwU1FULkLmFgZBgzt1miLLhg2BuBmnnhevwAqWNaBJMfT0zBHSGCMr5lV5c24NP+pIUFzc9+Fr0yL8c5pVRUdW3aOlNqfNN6Q26cPl9z1V7QaP+psOrgLD2NtrA9lt19fYJrqlV2PmuQ+Zxyi6h91+R0XfYRG49JPJECUiUYnz/T5FeZq4r4atUl12M90sGkAd459/hPiLAg27kffpmvbJi+Gu6kUnNJVeK5ztcdrVGfbdpQX7MiYp28W2VdRUmNsSkJ1T+6V74UMgNDR2Vwiy/Eg+66LPr1yYarhPWJ/n5kRBtIS+AAAA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t8hO6-0002y1-K6 for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 09:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Nov 2024 14:52: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.173090469811369 (code B ref 73752); Wed, 06 Nov 2024 14:52:02 +0000 Original-Received: (at 73752) by debbugs.gnu.org; 6 Nov 2024 14:51:38 +0000 Original-Received: from localhost ([127.0.0.1]:40277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8hNh-0002xJ-Ma for submit@debbugs.gnu.org; Wed, 06 Nov 2024 09:51:38 -0500 Original-Received: from mail-pf1-f193.google.com ([209.85.210.193]:49437) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8hNe-0002x3-Ux for 73752@debbugs.gnu.org; Wed, 06 Nov 2024 09:51:36 -0500 Original-Received: by mail-pf1-f193.google.com with SMTP id d2e1a72fcca58-71e625b00bcso6043479b3a.3 for <73752@debbugs.gnu.org>; Wed, 06 Nov 2024 06:51:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730904629; x=1731509429; 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=Kt2KbOLnvD81hDYA/BMxdojYq7q9+E2AsglntzmIYTM=; b=WNI+Ak9ZnKY4siv3EHfFGI5ZmxrDyZI+gq0uEyS0Kiy/EpMbYLI1nyOs8npkvqdtuE byR+pguX8y2oqb7pV2Lp5+8vAOtZjakjB6LxABsVikXKOXw6Gw90hOZNUoj3PFpWOa+D x1szmcv2HHaLgK9TCfaUVV2Sh6HUl4GpwHh2f+1pJi5SJZW7WZkgwwk71gjxwsLpk0tL OGK59Y+p6Tikae8rjDtHjkaZEMWEr0BPXyU82Y226KujZRs6sg1nbj6gs4Qs40ca4ezG 3i9O6TR1oYh2+y5HuIq385KH8zeRcubbvtw2CnZsmgCmkdMWSDiftDxgLeUFWC9c3krj ODvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730904629; x=1731509429; 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=Kt2KbOLnvD81hDYA/BMxdojYq7q9+E2AsglntzmIYTM=; b=gC8mwTbVBuWvjRSAkbuZhJ3nNSbDUnjQ89tAU+QaAB2XHYr2W6KZys3MaKeLk/lZro Ng8zu8ygaYzAPdGwYfT8VOqVqzIDUAdMDXpi+bmDI6VGRxqPZFtKNgA27RZjQkZwfXSR 3bSPNAMW8ucDDRekOXNVslyYivU/f4PLt5L8cLD4IlDhBLB/lDNHlvq/GCPfjA9kqzun FDtn3sMTUAo7D1CeY+5TTaWUBtVOUD0siwZxV4a0ytgEicBSegMvofpa75GBhRRHnfQW v8+gBlQBaqOWobj50aJUOvbfUbREtYi2qucdc2vNNF4fJ3wZ3YUnrrVmkDIcgx+oT4R8 6bEA== X-Forwarded-Encrypted: i=1; AJvYcCUrbGy/D+/cCipIWRn9lWQJQPdOv6EpoDl5kSxhkpI5P/Wu8okAt3fEaWUTPWx1NCwkkMK0wA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy1vl+HNdvhrdcS6ODyfdnwos8C/1l5Mbl1hKMPDex5QmnUjSnV uG/riYK5cYAUMFqMnQw1R51PIq938JZ7T0HjLv5jKAJmzEW0htKWsWzCB7B38uc= X-Google-Smtp-Source: AGHT+IE7saR80DOc+2k/n2+dKy0zhsXxZIlogmYbcFBmJVU2xWr4HivrNojQ/lrN2ebD/VHix8gy3g== X-Received: by 2002:a05:6a00:4655:b0:71e:5fa1:d3e4 with SMTP id d2e1a72fcca58-720b9bb3ef2mr30851828b3a.2.1730904628980; Wed, 06 Nov 2024 06:50:28 -0800 (PST) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ee45a0dfe2sm11243034a12.83.2024.11.06.06.50.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 06:50:28 -0800 (PST) In-Reply-To: <86y11yuc3x.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 04 Nov 2024 19:45:22 +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:294969 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=A8= =E0=AE=B5=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 04, 2024] Eli Zarets= kii 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:=20=20 > > Thanks. But do you understand why? > > And how did you arrive to the conclusion that this is the change which > might help? > >> diff --git a/src/ftfont.c b/src/ftfont.c >> index 882d3eec256..2be443108f1 100644 >> --- a/src/ftfont.c >> +++ b/src/ftfont.c >> @@ -2994,9 +2994,8 @@ fthbfont_begin_hb_font (struct font *font, double >> *position_unit) >> struct font_info *ftfont_info =3D (struct font_info *) font; >>=20=20 >> *position_unit =3D 1.0 / (1 << 6); >> - if (! ftfont_info->hb_font) >> - ftfont_info->hb_font >> - =3D hb_ft_font_create_referenced (ftfont_info->ft_size->face); >> + ftfont_info->hb_font >> + =3D hb_ft_font_create_referenced (ftfont_info->ft_size->face); >> return ftfont_info->hb_font; >> } >>=20=20 >> That is, it makes at least the bug with Yixuan's script disappear. I >> haven't yet verified if this fixes what I often see during my daily >> usage. > > That code was written by a leading HarfBuzz developer, so it's hard > for me to believe that it is so incorrect. > > 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? If so, I think the code > to look at is the end_hb_font method and what it does to the hb_font > object. 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. > > Visuwesh, do the problems you see also disappear when you install the > change in fthbfont_begin_hb_font which removes the > !ftfont_info->hb_font condition for calling > hb_ft_font_create_referenced? I cannot seem to reproduce the msialignment with that change either. Likewise for the change Tim posted further down the thread which changes ftcrhbfont_end_hb_font.