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#54646: 29.0.50; set-fontset-font and font clipping issues Date: Sat, 11 Jun 2022 19:24:16 +0530 Message-ID: <87tu8rs3uf.fsf@gmail.com> References: <875ynuokqt.fsf@gmail.com> <87lewqjh41.fsf@gmail.com> <83wnga5ap3.fsf@gnu.org> <87a6d69g46.fsf@gmail.com> <87h77dk3zn.fsf@gmail.com> <87a6d5jyat.fsf@gmail.com> <87wng989ym.fsf@gmail.com> <83ilrt5b1v.fsf@gnu.org> <87h77cetq9.fsf@gmail.com> <831qyg6cyt.fsf@gnu.org> <87czi0eoyx.fsf@gmail.com> <83wng84rf8.fsf@gnu.org> <874k3aede0.fsf@gmail.com> <83y20m32h2.fsf@gnu.org> <87zgl2cvj8.fsf@gmail.com> <83wng630fg.fsf@gnu.org> <87v8vqcthz.fsf@gmail.com> <87wnfitrqy.fsf@gmail.com> <83zgkdpoo2.fsf@gnu.org> <87pml9tmz4.fsf@gmail.com> <83r15ppf5b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29018"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: rpluim@gmail.com, 54646@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 11 15:55:33 2022 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 1o01aO-0007RQ-V7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Jun 2022 15:55:33 +0200 Original-Received: from localhost ([::1]:37050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o01aN-0006cT-Cm for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Jun 2022 09:55:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o01Zu-0006c4-Ob for bug-gnu-emacs@gnu.org; Sat, 11 Jun 2022 09:55:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o01Zu-0003TE-GR for bug-gnu-emacs@gnu.org; Sat, 11 Jun 2022 09:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o01Zu-0002Vb-ED for bug-gnu-emacs@gnu.org; Sat, 11 Jun 2022 09:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Jun 2022 13:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54646 X-GNU-PR-Package: emacs Original-Received: via spool by 54646-submit@debbugs.gnu.org id=B54646.16549556709591 (code B ref 54646); Sat, 11 Jun 2022 13:55:02 +0000 Original-Received: (at 54646) by debbugs.gnu.org; 11 Jun 2022 13:54:30 +0000 Original-Received: from localhost ([127.0.0.1]:52227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o01ZO-0002Ub-7n for submit@debbugs.gnu.org; Sat, 11 Jun 2022 09:54:30 -0400 Original-Received: from mail-pj1-f68.google.com ([209.85.216.68]:53919) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o01ZK-0002UI-6N for 54646@debbugs.gnu.org; Sat, 11 Jun 2022 09:54:28 -0400 Original-Received: by mail-pj1-f68.google.com with SMTP id a10so1763944pju.3 for <54646@debbugs.gnu.org>; Sat, 11 Jun 2022 06:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=aitvwkaVIrULeIf3bYkpbnJjJAjmylrb0IjgkCSR/iY=; b=JkUsVpaOPfjc0AHc7EfvQCH5zb+MMwhCNbEov4rlKvQhFYSJ3p1RMfQ14qaEW68r9C 0jrVZgpi8ane61TksttrtNxd6KNBCyxM2Cw7wPwYQ6VPAqCu6kVbAnim3m0OUZRD0qCq SIfwXdqdFDbj4swwpR6Y2mutsUF3/A3J94YYo72+iby3EZ6LhPDWL95Oaf3BvaLuMdlC l4Gzc3hrFZEl4PD4wql1X0tBHKC13qd/adzVA6vyZtEUmiAVkWTUJ/EwIgR6bvfKCRX3 vJHUp1iC9M7HTXefPDLnw34AJsfVasV0NSeNCo/NgSQ+r8abjMJRFUbdl5jKK3MIQYBV 9CqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=aitvwkaVIrULeIf3bYkpbnJjJAjmylrb0IjgkCSR/iY=; b=oFsRiQc76ARSkWqcroAemkn7EIsKwth//sn4YP2bVrwItuxcu5XG4mAno42YuFJ43J ctEyKqQ8eJCn6Kd0mkYUwVet34P9KI47qoHk7C+5gUh0Oh1ZLkFSvXZgn+aeW+F4PWZ3 9a+4yQQNFYqoeTHCIvHgXSuLlrclFV7P/Eph0K+Kgm0HN28V2aNyvdnW7VT5BFCqMePe f5tP4+Q/wRmJYAgQDiPlZyKcEzP0poNLLYv8lwVTPb2mwV4WCYS1SLbFD9WUIPvBVPPj AneCPETNZyYbTusphGdRsA0yiz9vh65lHCNRtl1iFwhLxjf+j7rnX/MikmGoWRDB3qBm iYOg== X-Gm-Message-State: AOAM530toYITFjqyglATbuDuiHqWs9IYecyhXj0q1VfZQ3z5YoDBxTYA RA62HAThzjx2Qut01MrThCQ= X-Google-Smtp-Source: ABdhPJxGVzT7SPzB4epgwOVTgfa74Lj4C2DfUJj3Q0Ca+kDEHiVuR+gr2mU1+enk7q9dAutmmPULYw== X-Received: by 2002:a17:902:e5cb:b0:165:1500:a69b with SMTP id u11-20020a170902e5cb00b001651500a69bmr16174995plf.29.1654955660326; Sat, 11 Jun 2022 06:54:20 -0700 (PDT) Original-Received: from localhost ([49.204.130.114]) by smtp.gmail.com with ESMTPSA id c125-20020a624e83000000b0051850716942sm1623570pfb.140.2022.06.11.06.54.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jun 2022 06:54:19 -0700 (PDT) In-Reply-To: <83r15ppf5b.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 22 Apr 2022 13:48:48 +0300") 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" Xref: news.gmane.io gmane.emacs.bugs:234286 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=8F=E0=AE=AA= =E0=AF=8D=E0=AE=B0=E0=AE=B2=E0=AF=8D 22, 2022] Eli Zaretskii wrote: Hello Eli, Robert >> From: Visuwesh >> Cc: rpluim@gmail.com, 54646@debbugs.gnu.org >> Date: Fri, 22 Apr 2022 16:16:07 +0530 >>=20 >> >> and the GOOD case for bb9 bbf is >> >>=20 >> >> lbearing 1 rbearing 28 width 28 ascent 9 descent 5 >> >> 1 bb9 bbf xadvance 1809 yadvance 0 xoffset 0 yoffset 0 >> >> xpos 0 yoff 0 wadjust 28 >> >>=20 >> >> and the BAD case is >> >>=20 >> >> lbearing 1 rbearing 28 width 28 ascent 9 descent 5 >> >> 1 bb9 bbf xadvance 3193 yadvance 0 xoffset 0 yoffset 0 >> >> xpos 0 yoff 0 wadjust 50 >> > >> > This looks like HarfBuzz is feeding us incorrect data for some reason, >> > but I cannot imagine what that reason could be, sorry. >>=20 >> Could it be some kind of cache? Because when Emacs rendered the entire >> webpage, I was unable to reproduce the issue. > > When Emacs have rendered the entire page, we no longer call HarfBuzz, > because the composition data is indeed cached by Emacs. > > The print-outs you produced are from calling HarfBuzz, so our caching > cannot affect that, AFAIU. I think this might be a cairo+pango problem. My suspicion is due to this bug report https://github.com/harfbuzz/harfbuzz/issues/1892 -- although I don't see the problem with English text as shown in the screenshots. I tried to turn off font metrics in cairo by applying the following patch, --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=cairo-hint-metrics.diff diff --git a/src/ftcrfont.c b/src/ftcrfont.c index 6bb41110d5..77753d30f4 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -176,6 +176,7 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) cairo_font_options_t *options = xsettings_get_font_options (); #else cairo_font_options_t *options = cairo_font_options_create (); + cairo_font_options_set_hint_metrics(options, CAIRO_HINT_METRICS_OFF); #endif #ifdef USE_BE_CAIRO if (be_use_subpixel_antialiasing ()) --=-=-= Content-Type: text/plain but that did not solve the issue. However, I have been using the xft+harfbuzz combo for a ~week now and I can say with confidence that I don't experience this strange issue. I would highly appreciate it if the decision to remove the xft backend could be delayed until a solution comes up [1]. Although the font rendering is worse, the text stays readable at all font sizes. [1] ./configure --with-cairo says, configure: WARNING: This configuration uses libXft, which has a number of font rendering issues, and is being considered for removal in the next release of Emacs. Please consider using Cairo graphics + HarfBuzz text shaping instead (they are auto-detected if the relevant development headers are installed). --=-=-=--